diff options
author | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-05-23 16:26:51 +0000 |
---|---|---|
committer | Adam Coldrick <adam.coldrick@codethink.co.uk> | 2014-05-23 16:32:53 +0000 |
commit | 898a7a286fc002543df02142867606403df2de30 (patch) | |
tree | bf9f693728f427c6ba2c51252923a2658bdefc13 | |
parent | 005d4a4889cc477e97f82afe8ec4e71ca6f302b4 (diff) | |
download | morph-898a7a286fc002543df02142867606403df2de30.tar.gz |
Add unit test to test the validation of cluster morphs
-rw-r--r-- | morphlib/morphloader_tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/morphlib/morphloader_tests.py b/morphlib/morphloader_tests.py index a050e10b..95030b00 100644 --- a/morphlib/morphloader_tests.py +++ b/morphlib/morphloader_tests.py @@ -458,6 +458,18 @@ build-system: dummy self.loader.validate(m) self.assertEqual(cm.exception.strata, ["foo"]) + def test_validate_requires_unique_deployment_names_in_cluster(self): + m = morphlib.morph3.Morphology( + name='cluster', + kind='cluster', + systems=[{'morph': 'foo', + 'deploy': {'deployment': {}}}, + {'morph': 'bar', + 'deploy': {'deployment': {}}}]) + self.assertRaises( + morphlib.morphloader.DuplicateDeploymentNameError, + self.loader.validate, m) + def test_loads_yaml_from_string(self): string = '''\ name: foo |