mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-11 04:21:03 +00:00
SDK update generated by liblab
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user