diff --git a/compress/compress.py b/compress/compress.py index 0cff043..4d2cec2 100644 --- a/compress/compress.py +++ b/compress/compress.py @@ -40,7 +40,6 @@ def __init__(self, api_key :str , customer_name : str): self.api_key = api_key self.customer_name = customer_name self.req = requests.Session() - self.req.base_url = TNGRM_BASE_URL self.client_id = customer_name + "_client" # #/** @@ -53,7 +52,7 @@ def __init__(self, api_key :str , customer_name : str): # } # */ def get_s3_space(self): - return self.req.post( S3_SPACE, + return self.req.post(TNGRM_BASE_URL + S3_SPACE, headers={ "Content-Type": "application/json", }, @@ -70,11 +69,11 @@ def get_s3_space(self): # * @returns list of categories of the customer # */ def get_categories(self): - return self.req.post( GET_CATEGORIES, + return self.req.post(TNGRM_BASE_URL + GET_CATEGORIES, headers={ "Content-Type": "application/json", }, - body = json.dumps({ + body = json.dumps(({ "api_key": self.api_key, "client_id": self.client_id, }) diff --git a/compress/tests/test_connection.py b/compress/tests/test_connection.py index 6b02124..4814953 100644 --- a/compress/tests/test_connection.py +++ b/compress/tests/test_connection.py @@ -37,7 +37,6 @@ class TestConnection(unittest.TestCase): # def setUp(self): self._conn = requests.Session() - self._conn.base_url = TNGRM_BASE_URL # @all_requests def response_content_success(self, url, request): @@ -47,7 +46,7 @@ def response_content_success(self, url, request): # def test_raw_get(self): with HTTMock(self.response_content_success): - resp = self._conn.get("/health") + resp = self._conn.get(TNGRM_BASE_URL + "/health") self.assertEqual(resp.content, b'response_ok') self.assertEqual(resp.status_code, 200) #