summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/image/test_glance.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/tests/image/test_glance.py b/nova/tests/image/test_glance.py
index 290c9a04a..9f866d790 100644
--- a/nova/tests/image/test_glance.py
+++ b/nova/tests/image/test_glance.py
@@ -22,11 +22,15 @@ import stubout
from nova.tests.api.openstack import fakes
from nova import context
from nova import exception
+from nova import flags
from nova.image import glance
from nova import test
from nova.tests.glance import stubs as glance_stubs
+FLAGS = flags.FLAGS
+
+
class NullWriter(object):
"""Used to test ImageService.get which takes a writer object"""
@@ -451,3 +455,10 @@ class TestGlanceImageService(test.TestCase):
image_meta = self.service.get(self.context, image_id, writer)
self.assertEqual(image_meta['created_at'], self.NOW_DATETIME)
self.assertEqual(image_meta['updated_at'], self.NOW_DATETIME)
+
+ def test_contruct_glance_url(self):
+ # TODO(jk0): This will eventually need to take SSL into consideration
+ # when supported in glance.
+ generated_url = glance._construct_glance_url()
+ actual_url = "http://%s:%d" % (FLAGS.glance_host, FLAGS.glance_port)
+ self.assertEqual(generated_url, actual_url)