summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-27 10:52:13 +0000
committerGerrit Code Review <review@openstack.org>2018-08-27 10:52:13 +0000
commit969cbbfacf3bfbff10518cb9e881c9249e8c7d81 (patch)
treec423a08588a5e4110da8c6967f6dd1b242584281
parent1312e25d9f3e5244518b29971f19bc870677c2b9 (diff)
parent843bf52beaf7addbb346789664fd34a3a765efe8 (diff)
Merge "Remove stub_out_registry_server method"
-rw-r--r--glance/tests/stubs.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/glance/tests/stubs.py b/glance/tests/stubs.py
index 80bf5c8..5aa027a 100644
--- a/glance/tests/stubs.py
+++ b/glance/tests/stubs.py
@@ -193,26 +193,3 @@ def stub_out_registry_and_store_server(stubs, base_dir, **kwargs):
193 glance.common.client.BaseClient._sendable) 193 glance.common.client.BaseClient._sendable)
194 stubs.Set(glance.common.client.BaseClient, '_sendable', 194 stubs.Set(glance.common.client.BaseClient, '_sendable',
195 fake_sendable) 195 fake_sendable)
196
197
198def stub_out_registry_server(stubs, **kwargs):
199 """Mocks calls to 127.0.0.1 on 9191 for testing.
200
201 Done so that a real Glance Registry server does not need to be up and
202 running.
203 """
204 def fake_get_connection_type(client):
205 """Returns the proper connection type."""
206 DEFAULT_REGISTRY_PORT = 9191
207
208 if (client.port == DEFAULT_REGISTRY_PORT and
209 client.host == '0.0.0.0'):
210 rserver = kwargs.pop("registry", None)
211 return FakeRegistryConnection(registry=rserver)
212
213 def fake_image_iter(self):
214 for i in self.response.app_iter:
215 yield i
216
217 stubs.Set(glance.common.client.BaseClient, 'get_connection_type',
218 fake_get_connection_type)