mirror of
https://github.com/LukeHagar/plexpy.git
synced 2025-12-09 20:57:44 +00:00
SDK update generated by liblab
This commit is contained in:
@@ -12,7 +12,7 @@ class TestActivities_(unittest.TestCase):
|
||||
@responses.activate
|
||||
def test_get_server_activities(self):
|
||||
# Mock the API response
|
||||
responses.get("{protocol}://{ip}:{port}/activities", json={}, status=200)
|
||||
responses.get("http://10.10.10.47:32400/activities", json={}, status=200)
|
||||
# call the method to test
|
||||
test_service = Activities("testkey")
|
||||
response = test_service.get_server_activities()
|
||||
@@ -22,7 +22,7 @@ class TestActivities_(unittest.TestCase):
|
||||
@responses.activate
|
||||
def test_get_server_activities_error_on_non_200(self):
|
||||
# Mock the API response
|
||||
responses.get("{protocol}://{ip}:{port}/activities", json={}, status=404)
|
||||
responses.get("http://10.10.10.47:32400/activities", json={}, status=404)
|
||||
with self.assertRaises(ClientException):
|
||||
test_service = Activities("testkey")
|
||||
test_service.get_server_activities()
|
||||
@@ -32,11 +32,11 @@ class TestActivities_(unittest.TestCase):
|
||||
def test_cancel_server_activities(self):
|
||||
# Mock the API response
|
||||
responses.delete(
|
||||
"{protocol}://{ip}:{port}/activities/3963273161", json={}, status=200
|
||||
"http://10.10.10.47:32400/activities/9191455277", json={}, status=200
|
||||
)
|
||||
# call the method to test
|
||||
test_service = Activities("testkey")
|
||||
response = test_service.cancel_server_activities("3963273161")
|
||||
response = test_service.cancel_server_activities("9191455277")
|
||||
self.assertEqual(response.data, {})
|
||||
responses.reset(),
|
||||
|
||||
@@ -44,7 +44,7 @@ class TestActivities_(unittest.TestCase):
|
||||
def test_cancel_server_activities_required_fields_missing(self):
|
||||
# Mock the API response
|
||||
responses.delete(
|
||||
"{protocol}://{ip}:{port}/activities/8877676477", json={}, status=202
|
||||
"http://10.10.10.47:32400/activities/6359244154", json={}, status=202
|
||||
)
|
||||
with self.assertRaises(TypeError):
|
||||
test_service = Activities("testkey")
|
||||
@@ -55,11 +55,11 @@ class TestActivities_(unittest.TestCase):
|
||||
def test_cancel_server_activities_error_on_non_200(self):
|
||||
# Mock the API response
|
||||
responses.delete(
|
||||
"{protocol}://{ip}:{port}/activities/6744354026", json={}, status=404
|
||||
"http://10.10.10.47:32400/activities/1590369420", json={}, status=404
|
||||
)
|
||||
with self.assertRaises(ClientException):
|
||||
test_service = Activities("testkey")
|
||||
test_service.cancel_server_activities("6744354026")
|
||||
test_service.cancel_server_activities("1590369420")
|
||||
responses.reset()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user