Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ push_to_twine.sh
./Pipfile
env/
.DS_STORE
.idea
5 changes: 3 additions & 2 deletions Maintaining.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion midtransclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .error_midtrans import MidtransAPIError
from .error_midtrans import JSONDecodeError

__version__ = '1.4.0'
__version__ = '1.4.1'
2 changes: 1 addition & 1 deletion midtransclient/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions tests/test_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down