Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Added tests for parser.py. #140

Merged
merged 3 commits into from
Mar 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2018 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys

from superflore.parser import get_parser
import unittest


class TestParserSetup(unittest.TestCase):
def test_get_parser(self):
"""Tests the get_parser function"""
p = get_parser('test parser')
self.assertEqual(p.prog, 'test parser')
sys.argv = []
ret = p.parse_args()
self.assertIn('all', ret)
self.assertIn('dry_run', ret)
self.assertIn('only', ret)
self.assertIn('output_repository_path', ret)
self.assertIn('pr_comment', ret)
self.assertIn('pr_only', ret)
self.assertIn('ros_distro', ret)
self.assertIn('upstream_repo', ret)