add unit testing and fix typo

This commit is contained in:
Chris MacNaughton
2018-10-10 12:14:15 +02:00
parent 362ce7bac5
commit 69c44551ff
2 changed files with 14 additions and 1 deletions

View File

@@ -106,3 +106,16 @@ class TestUtilitiesBundle(ut_utils.BaseTestCase):
expected = yaml.safe_load(TEST_BUNDLE_WITHOUT_PLACEMENT)
self.assertEqual(expected, flattened)
def test_parser(self):
args = bundle.parse_args([
'-i', 'bundle.yaml'])
self.assertEqual(args.input, 'bundle.yaml')
self.assertEqual(args.output, '/dev/stdout')
def test_parser_output(self):
args = bundle.parse_args([
'-i', 'bundle.yaml',
'-o', 'bundle_out.yaml'])
self.assertEqual(args.input, 'bundle.yaml')
self.assertEqual(args.output, 'bundle_out.yaml')

View File

@@ -21,7 +21,7 @@ import sys
def remove_machine_specification(input_yaml):
"""
Will remove the machien specifications from a supplied bundle.
Will remove the machine specifications from a supplied bundle.
:param input_yaml: Juju bundle to strip machinens from
:type input_yaml: dict