Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(580)

Unified Diff: juju/providers/maas/tests/test_maas.py

Issue 6569053: Add generic and tag constraints to maas provider
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: juju/providers/maas/tests/test_maas.py
=== modified file 'juju/providers/maas/tests/test_maas.py'
--- juju/providers/maas/tests/test_maas.py 2012-06-06 19:08:04 +0000
+++ juju/providers/maas/tests/test_maas.py 2012-09-25 08:58:47 +0000
@@ -336,3 +336,35 @@
self.assertIs(None, guinness)
name = client.post.params_used.get("name")
self.assertEqual("zaphod", name)
+
+ def test_acquire_node_handles_arch_constraint(self):
+ client = self.set_up_client_with_fake()
+ constraints = {"arch": "i386"}
+ client.acquire_node(constraints)
+
+ arch = client.post.params_used.get("arch")
+ self.assertEqual("i386", arch)
+
+ def test_acquire_node_handles_cpu_constraint(self):
+ client = self.set_up_client_with_fake()
+ constraints = {"cpu": 2}
+ client.acquire_node(constraints)
+
+ cpu_count = client.post.params_used.get("cpu_count")
+ self.assertEqual("2", cpu_count)
+
+ def test_acquire_node_handles_mem_constraint(self):
+ client = self.set_up_client_with_fake()
+ constraints = {"mem": 2048}
+ client.acquire_node(constraints)
+
+ mem = client.post.params_used.get("mem")
+ self.assertEqual("2048", mem)
+
+ def test_acquire_node_handles_arbitrary_tag_query(self):
+ client = self.set_up_client_with_fake()
+ constraints = {"maas-tags": "red&!white|blue"}
+ client.acquire_node(constraints)
+
+ tags = client.post.params_used.get("tags")
+ self.assertEqual("red&!white|blue", tags)

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 204d58d