| 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) |