def test_get_unknown_project(self, m):
     sde_client = SDEClient("http://localhost/sde", "Basic", None, "admin",
                            "admin", None)
     m.register_uri('GET',
                    SDEClient.GET_PROJECTS %
                    (sde_client.url, '1280', 'FAILED'),
                    status_Code=403)
     m.register_uri('GET',
                    SDEClient.GET_APPLICATIONS %
                    (sde_client.url, 'Application Test'),
                    json=json.loads(GET_APPLICATION_RESPONSE))
     sde_client.get_project('Application Test', 'FAILED')
 def test_get_unknown_authentication_method(self, m):
     sde_client = SDEClient("http://localhost/sde", "Unknown", None, None,
                            None, None)
     m.register_uri('GET',
                    SDEClient.GET_PROJECTS %
                    (sde_client.url, '1280', 'FAILED'),
                    json=json.loads(GET_PROJECT_RESPONSE))
     m.register_uri('GET',
                    SDEClient.GET_APPLICATIONS %
                    (sde_client.url, 'Application Test'),
                    json=json.loads(GET_APPLICATION_RESPONSE))
     sde_client.get_project('Application Test', 'FAILED')
 def test_get_project_token_auth(self, m):
     sde_client = SDEClient("http://localhost/sde", "PAT", None, None, None,
                            "1234abcd")
     m.register_uri('GET',
                    SDEClient.GET_PROJECTS %
                    (sde_client.url, '1', 'Project Test'),
                    json=json.loads(GET_PROJECT_RESPONSE))
     m.register_uri('GET',
                    SDEClient.GET_APPLICATIONS %
                    (sde_client.url, 'Application Test'),
                    json=json.loads(GET_APPLICATION_RESPONSE))
     eq_(
         json.loads(GET_PROJECT_RESPONSE)['results'][0],
         sde_client.get_project('Application Test', 'Project Test'))