← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/maas/kill-fake-papi-proxy into lp:maas

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/kill-fake-papi-proxy into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jtv/maas/kill-fake-papi-proxy/+merge/119910

Not very interesting, really, but thankfully it's a nice kind of size for a branch.  Remove yet another testing item related to the provisioning API proxy.


Jeroen
-- 
https://code.launchpad.net/~jtv/maas/kill-fake-papi-proxy/+merge/119910
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/maas/kill-fake-papi-proxy into lp:maas.
=== modified file 'src/maasserver/testing/__init__.py'
--- src/maasserver/testing/__init__.py	2012-04-27 12:38:18 +0000
+++ src/maasserver/testing/__init__.py	2012-08-16 12:38:30 +0000
@@ -14,7 +14,6 @@
     "extract_redirect",
     "get_content_links",
     "get_data",
-    "get_fake_provisioning_api_proxy",
     "get_prefixed_form_data",
     "reload_object",
     "reload_objects",
@@ -23,43 +22,8 @@
 import httplib
 import os
 from urlparse import urlparse
-from uuid import uuid1
 
 from lxml.html import fromstring
-from provisioningserver.testing import fakeapi
-
-# Current (singleton) fake provisioning API server.
-fake_provisioning_proxy = None
-
-
-def get_fake_provisioning_api_proxy():
-    """Produce a fake provisioning API proxy.
-
-    The fake server is a singleton, so as to provide a realistically coherent
-    fake session.  If you want a clean slate, call
-    `reset_fake_provisioning_api_proxy` and the next call here will create a
-    fresh instance.
-    """
-    global fake_provisioning_proxy
-    if fake_provisioning_proxy is None:
-        fake_provisioning_proxy = fakeapi.FakeSynchronousProvisioningAPI()
-        distro = fake_provisioning_proxy.add_distro(
-            "distro-%s" % uuid1().get_hex(),
-            "initrd", "kernel")
-        fake_provisioning_proxy.add_profile(
-            "profile-%s" % uuid1().get_hex(),
-            distro)
-    return fake_provisioning_proxy
-
-
-def reset_fake_provisioning_api_proxy():
-    """Reset the fake provisioning API server.
-
-    The next call to `get_fake_provisioning_api_proxy` will create a fresh
-    instance.
-    """
-    global fake_provisioning_proxy
-    fake_provisioning_proxy = None
 
 
 def extract_redirect(http_response):

=== modified file 'src/maasserver/testing/testcase.py'
--- src/maasserver/testing/testcase.py	2012-06-07 11:44:14 +0000
+++ src/maasserver/testing/testcase.py	2012-08-16 12:38:30 +0000
@@ -18,7 +18,6 @@
     ]
 
 from django.core.cache import cache
-from maasserver.testing import reset_fake_provisioning_api_proxy
 from maasserver.testing.factory import factory
 from maastesting.celery import CeleryFixture
 import maastesting.djangotestcase
@@ -29,7 +28,6 @@
     def setUp(self):
         super(TestCase, self).setUp()
         self.addCleanup(cache.clear)
-        self.addCleanup(reset_fake_provisioning_api_proxy)
         self.celery = self.useFixture(CeleryFixture())