def test_generate_mpl_wrong_classes_dir(self):
     args = TestArgs()
     args.classes_dir = '/home/this/path/does/not/exist'
     expected = ("'--classes-dir' parameter should be a directory", )
     try:
         mpl_package.generate_manifest(args)
     except exceptions.CommandError as message:
         self.assertEqual(expected, message.args)
 def test_generate_mpl_wrong_classes_dir(self):
     args = TestArgs()
     args.classes_dir = '/home/this/path/does/not/exist'
     expected = ("'--classes-dir' parameter should be a directory", )
     try:
         mpl_package.generate_manifest(args)
     except exceptions.CommandError as message:
         self.assertEqual(expected, message.args)
Beispiel #3
0
    def test_generate_mpl_manifest_with_all_parameters(self):
        args = TestArgs()
        args.template = TEMPLATE
        args.classes_dir = CLASSES_DIR
        args.resources_dir = RESOURCES_DIR
        args.type = 'Application'
        args.name = 'test_name'
        args.author = 'TestAuthor'
        args.full_name = 'test.full.name.TestName'
        args.tags = ['test', 'tag', 'Heat']
        args.description = 'Test description'

        expected_manifest = {
            'Format': 'MuranoPL/1.0',
            'Type': 'Application',
            'Classes': {
                'io.murano.apps.test.APP': 'testapp.yaml'
            },
            'FullName': 'test.full.name.TestName',
            'Name': 'test_name',
            'Description': 'Test description',
            'Author': 'TestAuthor',
            'Tags': ['test', 'tag', 'Heat']
        }
        result_manifest = mpl_package.generate_manifest(args)
        self.check_dict_is_subset(expected_manifest, result_manifest)
Beispiel #4
0
    def test_generate_mpl_manifest(self):
        args = TestArgs()
        args.template = TEMPLATE
        args.classes_dir = CLASSES_DIR
        args.resources_dir = RESOURCES_DIR
        args.type = 'Application'
        args.author = 'TestAuthor'
        args.name = None
        args.full_name = None
        args.tags = None
        args.description = None

        expected_manifest = {
            'Format': 'MuranoPL/1.0',
            'Type': 'Application',
            'Classes': {
                'io.murano.apps.test.APP': 'testapp.yaml'
            },
            'FullName': 'io.murano.apps.test.APP',
            'Name': 'APP',
            'Description': 'Description for the application is not provided',
            'Author': 'TestAuthor',
        }
        result_manifest = mpl_package.generate_manifest(args)
        self.check_dict_is_subset(expected_manifest, result_manifest)
    def test_generate_mpl_manifest(self):
        args = TestArgs()
        args.template = TEMPLATE
        args.classes_dir = CLASSES_DIR
        args.resources_dir = RESOURCES_DIR
        args.type = 'Application'
        args.author = 'TestAuthor'
        args.name = None
        args.full_name = None
        args.tags = None
        args.description = None

        expected_manifest = {
            'Format': 'MuranoPL/1.0',
            'Type': 'Application',
            'Classes': {'io.murano.apps.test.APP': 'testapp.yaml'},
            'FullName': 'io.murano.apps.test.APP',
            'Name': 'APP',
            'Description': 'Description for the application is not provided',
            'Author': 'TestAuthor',
        }
        result_manifest = mpl_package.generate_manifest(args)
        self.check_dict_is_subset(expected_manifest, result_manifest)
    def test_generate_mpl_manifest_with_all_parameters(self):
        args = TestArgs()
        args.template = TEMPLATE
        args.classes_dir = CLASSES_DIR
        args.resources_dir = RESOURCES_DIR
        args.type = 'Application'
        args.name = 'test_name'
        args.author = 'TestAuthor'
        args.full_name = 'test.full.name.TestName'
        args.tags = ['test', 'tag', 'Heat']
        args.description = 'Test description'

        expected_manifest = {
            'Format': 'MuranoPL/1.0',
            'Type': 'Application',
            'Classes': {'io.murano.apps.test.APP': 'testapp.yaml'},
            'FullName': 'test.full.name.TestName',
            'Name': 'test_name',
            'Description': 'Test description',
            'Author': 'TestAuthor',
            'Tags': ['test', 'tag', 'Heat']
        }
        result_manifest = mpl_package.generate_manifest(args)
        self.check_dict_is_subset(expected_manifest, result_manifest)