summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-05-23 16:26:51 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-06-11 12:49:25 +0000
commit9bbbdd898922df7c40395ed32a756cdfb7a5d42a (patch)
tree0d6e4f0a1f4e485ff26f3a1943dcdb5466340d5b
parent01c350a1b33e2eb40f2241d5b98ae17da96d598a (diff)
downloadmorph-9bbbdd898922df7c40395ed32a756cdfb7a5d42a.tar.gz
Add unit test to test the validation of cluster morphs
-rw-r--r--morphlib/morphloader_tests.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/morphlib/morphloader_tests.py b/morphlib/morphloader_tests.py
index a050e10b..5efcd689 100644
--- a/morphlib/morphloader_tests.py
+++ b/morphlib/morphloader_tests.py
@@ -458,6 +458,21 @@ build-system: dummy
self.loader.validate(m)
self.assertEqual(cm.exception.strata, ["foo"])
+ def test_validate_requires_unique_deployment_names_in_cluster(self):
+ subsystem = [{'morph': 'baz', 'deploy': {'foobar': None}}]
+ m = morphlib.morph3.Morphology(
+ name='cluster',
+ kind='cluster',
+ systems=[{'morph': 'foo',
+ 'deploy': {'deployment': {}},
+ 'subsystems': subsystem},
+ {'morph': 'bar',
+ 'deploy': {'deployment': {}},
+ 'subsystems': subsystem}])
+ self.assertRaises(
+ morphlib.morphloader.DuplicateDeploymentNameError,
+ self.loader.validate, m)
+
def test_loads_yaml_from_string(self):
string = '''\
name: foo