예제 #1
0
 def test_init(self):
     self.stub_auth()
     session = ospurge.Session(USERNAME, PASSWORD,
                               client_fixtures.PROJECT_ID, AUTH_URL)
     self.assertEqual(session.token, client_fixtures.TOKEN_ID)
     self.assertEqual(session.user_id, client_fixtures.USER_ID)
     self.assertEqual(session.project_id, client_fixtures.PROJECT_ID)
예제 #2
0
 def test_get_public_endpoint(self):
     self.stub_auth()
     session = ospurge.Session(USERNAME, PASSWORD,
                               client_fixtures.PROJECT_ID, AUTH_URL)
     endpoint = session.get_endpoint('volume')
     self.assertEqual(endpoint, client_fixtures.VOLUME_PUBLIC_ENDPOINT)
     endpoint = session.get_endpoint('image')
     self.assertEqual(endpoint, client_fixtures.IMAGE_PUBLIC_ENDPOINT)
예제 #3
0
 def test_get_internal_endpoint(self):
     self.stub_auth()
     session = ospurge.Session(USERNAME,
                               PASSWORD,
                               client_fixtures.PROJECT_ID,
                               AUTH_URL,
                               endpoint_type='internalURL')
     endpoint = session.get_endpoint('volume')
     self.assertEqual(endpoint, client_fixtures.VOLUME_INTERNAL_ENDPOINT)
     endpoint = session.get_endpoint('image')
     self.assertEqual(endpoint, client_fixtures.IMAGE_INTERNAL_ENDPOINT)
예제 #4
0
 def setUp(self):
     super(TestResourcesBase, self).setUp()
     self.stub_auth()
     self.session = ospurge.Session(USERNAME, PASSWORD,
                                    client_fixtures.PROJECT_ID, AUTH_URL)