コード例 #1
0
ファイル: launchpad.py プロジェクト: aminba90/PythonCourse
 def get_token_and_login(cls,
                         consumer_name,
                         service_root=None,
                         cache=None,
                         timeout=None,
                         proxy_info=None):
     """Get credentials from Launchpad and log into the service root."""
     from launchpadlib.testing.resources import get_application
     return cls(object(), application=get_application())
コード例 #2
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)
コード例 #3
0
ファイル: launchpad.py プロジェクト: aminba90/PythonCourse
 def login_with(cls,
                consumer_name,
                service_root=None,
                launchpadlib_dir=None,
                timeout=None,
                proxy_info=None):
     """Log in to Launchpad with possibly cached credentials."""
     from launchpadlib.testing.resources import get_application
     return cls(object(), application=get_application())
コード例 #4
0
 def __init__(self, credentials=None, service_root=None, cache=None,
              timeout=None, proxy_info=None, application=None):
     if application is None:
         from launchpadlib.testing.resources import get_application
         application = get_application()
     root_resource = FakeRoot(application)
     self.__dict__.update({"credentials": credentials,
                           "_application": application,
                           "_service_root": root_resource})
コード例 #5
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)
コード例 #6
0
ファイル: launchpad.py プロジェクト: aminba90/PythonCourse
 def login(cls,
           consumer_name,
           token_string,
           access_secret,
           service_root=None,
           cache=None,
           timeout=None,
           proxy_info=None):
     """Convenience for setting up access credentials."""
     from launchpadlib.testing.resources import get_application
     return cls(object(), application=get_application())
コード例 #7
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)
コード例 #8
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)
コード例 #9
0
ファイル: launchpad.py プロジェクト: aminba90/PythonCourse
 def __init__(self,
              credentials=None,
              service_root=None,
              cache=None,
              timeout=None,
              proxy_info=None,
              application=None):
     if application is None:
         from launchpadlib.testing.resources import get_application
         application = get_application()
     root_resource = FakeRoot(application)
     self.__dict__.update({
         "credentials": credentials,
         "_application": application,
         "_service_root": root_resource
     })
コード例 #10
0
 def test_create_root_resource(self):
     root_resource = FakeRoot(get_application())
     self.assertTrue(isinstance(root_resource, FakeResource))
コード例 #11
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)
コード例 #12
0
 def test_create_root_resource(self):
     root_resource = FakeRoot(get_application())
     self.assertTrue(isinstance(root_resource, FakeResource))
コード例 #13
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)
コード例 #14
0
 def login_with(cls, consumer_name, service_root=None,
                launchpadlib_dir=None, timeout=None, proxy_info=None):
     """Log in to Launchpad with possibly cached credentials."""
     from launchpadlib.testing.resources import get_application
     return cls(object(), application=get_application())
コード例 #15
0
 def get_token_and_login(cls, consumer_name, service_root=None,
                         cache=None, timeout=None, proxy_info=None):
     """Get credentials from Launchpad and log into the service root."""
     from launchpadlib.testing.resources import get_application
     return cls(object(), application=get_application())
コード例 #16
0
 def login(cls, consumer_name, token_string, access_secret,
           service_root=None, cache=None, timeout=None, proxy_info=None):
     """Convenience for setting up access credentials."""
     from launchpadlib.testing.resources import get_application
     return cls(object(), application=get_application())