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,31 +12,31 @@ class TestHubs_(unittest.TestCase):
@responses.activate
def test_get_global_hubs(self):
# Mock the API response
responses.get("{protocol}://{ip}:{port}/hubs", json={}, status=200)
responses.get("http://10.10.10.47:32400/hubs", json={}, status=200)
# call the method to test
test_service = Hubs("testkey")
response = test_service.get_global_hubs(8, 4)
response = test_service.get_global_hubs(2, 2)
self.assertEqual(response.data, {})
responses.reset(),
@responses.activate
def test_get_global_hubs_error_on_non_200(self):
# Mock the API response
responses.get("{protocol}://{ip}:{port}/hubs", json={}, status=404)
responses.get("http://10.10.10.47:32400/hubs", json={}, status=404)
with self.assertRaises(ClientException):
test_service = Hubs("testkey")
test_service.get_global_hubs(8, 3)
test_service.get_global_hubs(7, 5)
responses.reset()
@responses.activate
def test_get_library_hubs(self):
# Mock the API response
responses.get(
"{protocol}://{ip}:{port}/hubs/sections/3684333305", json={}, status=200
"http://10.10.10.47:32400/hubs/sections/7302320686", json={}, status=200
)
# call the method to test
test_service = Hubs("testkey")
response = test_service.get_library_hubs(3684333305, 2, 4)
response = test_service.get_library_hubs(7302320686, 4, 1)
self.assertEqual(response.data, {})
responses.reset(),
@@ -44,7 +44,7 @@ class TestHubs_(unittest.TestCase):
def test_get_library_hubs_required_fields_missing(self):
# Mock the API response
responses.get(
"{protocol}://{ip}:{port}/hubs/sections/2635728470", json={}, status=202
"http://10.10.10.47:32400/hubs/sections/8066749835", json={}, status=202
)
with self.assertRaises(TypeError):
test_service = Hubs("testkey")
@@ -55,11 +55,11 @@ class TestHubs_(unittest.TestCase):
def test_get_library_hubs_error_on_non_200(self):
# Mock the API response
responses.get(
"{protocol}://{ip}:{port}/hubs/sections/5770327453", json={}, status=404
"http://10.10.10.47:32400/hubs/sections/4815305500", json={}, status=404
)
with self.assertRaises(ClientException):
test_service = Hubs("testkey")
test_service.get_library_hubs(5770327453, 9, 3)
test_service.get_library_hubs(4815305500, 9, 9)
responses.reset()