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