예제 #1
0
 def test_login_with(self):
     """
     L{FakeLaunchpad.login_with} ignores all parameters and returns a new
     instance using the builtin WADL definition.
     """
     launchpad = FakeLaunchpad.login_with("name")
     self.assertTrue(isinstance(launchpad, FakeLaunchpad))
예제 #2
0
 def test_login_with(self):
     """
     L{FakeLaunchpad.login_with} ignores all parameters and returns a new
     instance using the builtin WADL definition.
     """
     launchpad = FakeLaunchpad.login_with("name")
     self.assertTrue(isinstance(launchpad, FakeLaunchpad))
예제 #3
0
 def test_wb_instantiate_without_application(self):
     """
     The builtin WADL definition is used if the C{application} is not
     provided during instantiation.
     """
     credentials = object()
     launchpad = FakeLaunchpad(credentials)
     self.assertEqual(credentials, launchpad.credentials)
     self.assertEqual(get_application(), launchpad._application)
예제 #4
0
 def test_instantiate_with_everything(self):
     """
     L{FakeLaunchpad} takes the same parameters as L{Launchpad} during
     instantiation, with the addition of an C{application} parameter.  The
     optional parameters are discarded when the object is instantiated.
     """
     credentials = object()
     launchpad = FakeLaunchpad(credentials,
                               service_root=None,
                               cache=None,
                               timeout=None,
                               proxy_info=None,
                               application=get_application())
     self.assertEqual(credentials, launchpad.credentials)
예제 #5
0
 def test_instantiate_with_credentials(self):
     """A L{FakeLaunchpad} can be instantiated with credentials."""
     credentials = object()
     launchpad = FakeLaunchpad(credentials, application=get_application())
     self.assertEqual(credentials, launchpad.credentials)
예제 #6
0
 def make(self, dependency_resources):
     return FakeLaunchpad(application=Application(
         "https://api.example.com/testing/",
         resource_string("launchpadlib.testing", "testing-wadl.xml")))