SDK update generated by liblab

This commit is contained in:
Luke Hagar
2023-10-26 22:45:52 -05:00
parent e92d7e6c6b
commit f1f96fe82b
29 changed files with 446 additions and 437 deletions

View File

@@ -12,7 +12,7 @@ class TestSecurity_(unittest.TestCase):
@responses.activate
def test_get_transient_token(self):
# Mock the API response
responses.get("{protocol}://{ip}:{port}/security/token", json={}, status=200)
responses.get("http://10.10.10.47:32400/security/token", json={}, status=200)
# call the method to test
test_service = Security("testkey")
response = test_service.get_transient_token("all", "delegation")
@@ -22,7 +22,7 @@ class TestSecurity_(unittest.TestCase):
@responses.activate
def test_get_transient_token_required_fields_missing(self):
# Mock the API response
responses.get("{protocol}://{ip}:{port}/security/token", json={}, status=202)
responses.get("http://10.10.10.47:32400/security/token", json={}, status=202)
with self.assertRaises(TypeError):
test_service = Security("testkey")
test_service.get_transient_token()
@@ -31,7 +31,7 @@ class TestSecurity_(unittest.TestCase):
@responses.activate
def test_get_transient_token_error_on_non_200(self):
# Mock the API response
responses.get("{protocol}://{ip}:{port}/security/token", json={}, status=404)
responses.get("http://10.10.10.47:32400/security/token", json={}, status=404)
with self.assertRaises(ClientException):
test_service = Security("testkey")
test_service.get_transient_token("all", "delegation")
@@ -41,11 +41,11 @@ class TestSecurity_(unittest.TestCase):
def test_get_source_connection_information(self):
# Mock the API response
responses.get(
"{protocol}://{ip}:{port}/security/resources", json={}, status=200
"http://10.10.10.47:32400/security/resources", json={}, status=200
)
# call the method to test
test_service = Security("testkey")
response = test_service.get_source_connection_information("provident")
response = test_service.get_source_connection_information("similique")
self.assertEqual(response.data, {})
responses.reset(),
@@ -53,7 +53,7 @@ class TestSecurity_(unittest.TestCase):
def test_get_source_connection_information_required_fields_missing(self):
# Mock the API response
responses.get(
"{protocol}://{ip}:{port}/security/resources", json={}, status=202
"http://10.10.10.47:32400/security/resources", json={}, status=202
)
with self.assertRaises(TypeError):
test_service = Security("testkey")
@@ -64,11 +64,11 @@ class TestSecurity_(unittest.TestCase):
def test_get_source_connection_information_error_on_non_200(self):
# Mock the API response
responses.get(
"{protocol}://{ip}:{port}/security/resources", json={}, status=404
"http://10.10.10.47:32400/security/resources", json={}, status=404
)
with self.assertRaises(ClientException):
test_service = Security("testkey")
test_service.get_source_connection_information("molestiae")
test_service.get_source_connection_information("facere")
responses.reset()