Beispiel #1
0
 def test_status(self):
     api = LowLevelAPI(private_endpoint=self.INTERN_ENDPOINT, public_endpoint=self.PUBLIC_ENDPOINT,
                       api_key=self.API_KEY)
     with mock.patch('sxapi.low.BaseAPI.session') as patched_session:
         r = api.get_public_status()
         self.assertTrue(r)
         call = patched_session.get.call_args_list
         self.assertEqual(call[0][0][0], "http://0.0.0.0:8989/publicapi/v1/service/status")
     with mock.patch('sxapi.low.BaseAPI.session') as patched_session:
         r = api.get_private_status()
         self.assertTrue(r)
         call = patched_session.get.call_args_list
         self.assertEqual(call[0][0][0], "http://0.0.0.0:8787/internapi/v0/")
Beispiel #2
0
 def test_status(self):
     api = LowLevelAPI(private_endpoint=self.INTERN_ENDPOINT,
                       public_endpoint=self.PUBLIC_ENDPOINT,
                       api_key=self.API_KEY)
     with MockGet() as patched_session:
         r = api.get_public_status()
         self.assertTrue(r)
         call = patched_session.call_args_list
         self.assertEqual(call[0][0][0], "/service/status")
     with MockGet() as patched_session:
         r = api.get_private_status()
         self.assertTrue(r)
         call = patched_session.call_args_list
         self.assertEqual(call[0][0][0], "/")