aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/contexts/test_model.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/benchmark/contexts/test_model.py')
-rw-r--r--tests/unit/benchmark/contexts/test_model.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/benchmark/contexts/test_model.py b/tests/unit/benchmark/contexts/test_model.py
index 537a8c008..a4b7d81ef 100644
--- a/tests/unit/benchmark/contexts/test_model.py
+++ b/tests/unit/benchmark/contexts/test_model.py
@@ -180,6 +180,7 @@ class ServerTestCase(unittest.TestCase):
self.assertEqual(test_server.keypair_name, 'some-keys')
self.assertEqual(test_server.secgroup_name, 'some-secgroup')
self.assertEqual(test_server.placement_groups, [])
+ self.assertIsNone(test_server.server_group)
self.assertEqual(test_server.instances, 1)
self.assertIsNone(test_server.floating_ip)
self.assertIsNone(test_server._image)
@@ -195,6 +196,15 @@ class ServerTestCase(unittest.TestCase):
self.assertRaises(ValueError, model.Server, 'foo',
self.mock_context, attrs)
+ @mock.patch('yardstick.benchmark.contexts.model.PlacementGroup')
+ def test_construct_get_wrong_server_group(self, mock_sg):
+
+ attrs = {'server_group': 'baz'}
+ mock_sg.get.return_value = None
+
+ self.assertRaises(ValueError, model.Server, 'foo',
+ self.mock_context, attrs)
+
@mock.patch('yardstick.benchmark.contexts.heat.HeatTemplate')
def test__add_instance(self, mock_template):