Commit a45f21c4 authored by Jérome Perrin's avatar Jérome Perrin

tests.slap: use different hostnames for navigator tests

Since 65f73750 the URLs are cached, so
test was failing because they were not isolated.
parent e7940670
...@@ -393,7 +393,7 @@ class TestSlap(SlapMixin): ...@@ -393,7 +393,7 @@ class TestSlap(SlapMixin):
} }
with httmock.HTTMock(handler): with httmock.HTTMock(handler):
self.slap.initializeConnection('http://bar') self.slap.initializeConnection('http://%s' % self.id())
self.assertEqual( self.assertEqual(
self.slap._hateoas_navigator.slapos_master_hateoas_uri, self.slap._hateoas_navigator.slapos_master_hateoas_uri,
hateoas_url hateoas_url
...@@ -411,7 +411,7 @@ class TestSlap(SlapMixin): ...@@ -411,7 +411,7 @@ class TestSlap(SlapMixin):
self.fail('slap should not have contacted master to get Hateoas URL.') self.fail('slap should not have contacted master to get Hateoas URL.')
with httmock.HTTMock(handler): with httmock.HTTMock(handler):
self.slap.initializeConnection('http://bar', slapgrid_rest_uri=hateoas_url) self.slap.initializeConnection('http://%s' % self.id(), slapgrid_rest_uri=hateoas_url)
self.assertEqual( self.assertEqual(
self.slap._hateoas_navigator.slapos_master_hateoas_uri, self.slap._hateoas_navigator.slapos_master_hateoas_uri,
hateoas_url hateoas_url
...@@ -431,9 +431,10 @@ class TestSlap(SlapMixin): ...@@ -431,9 +431,10 @@ class TestSlap(SlapMixin):
} }
with httmock.HTTMock(handler): with httmock.HTTMock(handler):
self.slap.initializeConnection('http://bar') self.slap.initializeConnection('http://%s' % self.id())
self.assertEqual(None, getattr(self.slap, '_hateoas_navigator', None)) self.assertEqual(None, getattr(self.slap, '_hateoas_navigator', None))
class TestComputer(SlapMixin): class TestComputer(SlapMixin):
""" """
Tests slapos.slap.slap.Computer class functionality Tests slapos.slap.slap.Computer class functionality
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment