diff --git a/.gitignore b/.gitignore index 01f3a95..d803b5e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ push_to_twine.sh ./Pipfile env/ .DS_STORE +.idea \ No newline at end of file diff --git a/Maintaining.md b/Maintaining.md index d5dad64..6874f39 100644 --- a/Maintaining.md +++ b/Maintaining.md @@ -12,8 +12,9 @@ - Install project as local package `pip install -e .` - Make your code changes - Increase `version` value on: - - `./setup.py` file - - `./midtransclient/__init__.py` file + - `./setup.py` file + - `./midtransclient/__init__.py` file + - `./midtransclient/http_client.py` file on User-Agent value - To install the package locally with a symlink `pip install -e .` - To run test, run `pytest` - To run specific test, e.g: `pytest -k "test_core_api_charge_fail_401"` diff --git a/midtransclient/__init__.py b/midtransclient/__init__.py index e90f0f8..6caff84 100644 --- a/midtransclient/__init__.py +++ b/midtransclient/__init__.py @@ -4,4 +4,4 @@ from .error_midtrans import MidtransAPIError from .error_midtrans import JSONDecodeError -__version__ = '1.4.0' +__version__ = '1.4.1' diff --git a/midtransclient/http_client.py b/midtransclient/http_client.py index a72bd08..1a0bffd 100644 --- a/midtransclient/http_client.py +++ b/midtransclient/http_client.py @@ -39,7 +39,7 @@ def request(self, method, server_key, request_url, parameters=dict(), default_headers = { 'content-type': 'application/json', 'accept': 'application/json', - 'user-agent': 'midtransclient-python/1.2.0' + 'user-agent': 'midtransclient-python/1.4.1' } headers = default_headers diff --git a/setup.py b/setup.py index b21ba9d..6e8158f 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( name="midtransclient", - version="1.4.0", + version="1.4.1", author="Midtrans - Integration Support Team", author_email="support@midtrans.com", license='MIT', diff --git a/tests/test_http_client.py b/tests/test_http_client.py index 8d3e7b9..27f9aee 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -68,7 +68,7 @@ def test_is_custom_headers_applied(): custom_headers=custom_headers) # Fetch the headers from requests.request arguments - headers = mock_request.call_args.kwargs['headers'] + headers = mock_request.call_args[1]['headers'] # Make sure default header still exist assert headers.get('content-type') == 'application/json' diff --git a/tests/test_snap.py b/tests/test_snap.py index b16ddc3..5fa2d8c 100644 --- a/tests/test_snap.py +++ b/tests/test_snap.py @@ -58,7 +58,7 @@ def test_snap_status_fail_404(): def test_snap_request_fail_401(): snap = generate_snap_instance() - snap.api_config.server_key='' + snap.api_config.server_key='dummy' param = generate_param_min() err = '' try: @@ -94,7 +94,7 @@ def test_snap_request_fail_zero_gross_amount(): def test_snap_exception_MidtransAPIError(): snap = generate_snap_instance() - snap.api_config.server_key='' + snap.api_config.server_key='dummy' param = generate_param_min() err = '' try: