diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-12-02 10:08:56 -0600 |
|---|---|---|
| committer | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-12-02 10:08:56 -0600 |
| commit | 3af6da1fa5a38c8238ea45a7b03a6e3fbb78fe5b (patch) | |
| tree | 4ca43ad16ac0b7f5d430b8c71c5f599ff4a0a5c7 /nova/tests | |
| parent | f8afbcc08b65d4d6764a6dc66c804816573ab3b4 (diff) | |
Default Instance.display_name to a value even when None is explicitly passed in.
Diffstat (limited to 'nova/tests')
| -rw-r--r-- | nova/tests/compute_unittest.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/nova/tests/compute_unittest.py b/nova/tests/compute_unittest.py index 71a1a4457..85992b48c 100644 --- a/nova/tests/compute_unittest.py +++ b/nova/tests/compute_unittest.py @@ -66,6 +66,16 @@ class ComputeTestCase(test.TrialTestCase): inst['ami_launch_index'] = 0 return db.instance_create(self.context, inst)['id'] + def test_create_instance_defaults_display_name(self): + """Verify that an instance cannot be created without a display_name.""" + cases = [dict(), dict(display_name=None)] + for instance in cases: + ref = self.compute.create_instance(self.context, None, **instance) + try: + self.assertNotEqual(ref.display_name, None) + finally: + db.instance_destroy(self.context, ref['id']) + def test_create_instance_associates_security_groups(self): """Make sure create_instance associates security groups""" inst = {} |
