diff --git a/compress/compress.py b/compress/compress.py index b5ed4b1..0cff043 100644 --- a/compress/compress.py +++ b/compress/compress.py @@ -40,6 +40,7 @@ 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" # #/** @@ -52,7 +53,7 @@ def __init__(self, api_key :str , customer_name : str): # } # */ def get_s3_space(self): - return self.req.post(TNGRM_BASE_URL + S3_SPACE, + return self.req.post( S3_SPACE, headers={ "Content-Type": "application/json", }, @@ -69,7 +70,7 @@ def get_s3_space(self): # * @returns list of categories of the customer # */ def get_categories(self): - return self.req.post(TNGRM_BASE_URL + GET_CATEGORIES, + return self.req.post( GET_CATEGORIES, headers={ "Content-Type": "application/json", }, diff --git a/compress/tests/test_connection.py b/compress/tests/test_connection.py index d1dada1..6b02124 100644 --- a/compress/tests/test_connection.py +++ b/compress/tests/test_connection.py @@ -24,6 +24,7 @@ # from unittest import mock import requests +from ..constants import * from httmock import urlmatch, response, HTTMock, all_requests # try: @@ -36,6 +37,7 @@ 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):