Skip to content

fix(sdk): Fixing test #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2024
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
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import enum
import logging
import os
import random
import string
Expand Down Expand Up @@ -123,8 +124,10 @@ def __construct_sandbox_test_config():
@pytest.fixture(scope="session")
def sat_config(make_httpserver: HTTPServer, env: TestEnvironment):
if env == TestEnvironment.LOCAL:
logging.info("Using local test config")
return __construct_local_test_config(make_httpserver)
elif env == TestEnvironment.SANDBOX:
logging.info("Using sandbox test config")
return __construct_sandbox_test_config()
else:
raise ValueError(f"Invalid environment: {env}")
Expand Down
20 changes: 10 additions & 10 deletions tests/test_inquiry.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,26 +263,26 @@ def test_inquiry_success_downline_id(
response_json={
"data": {
"type": "inquiry",
"id": "2121212",
"id": "111111111111",
"attributes": {
"admin_fee": 2500,
"base_price": 25000,
"client_name": "TOKOPXXXX UXX",
"client_number": "2121212",
"client_number": "111111111111",
"fields": [{"name": "optional", "value": "optional"}],
"inquiry_result": [
{"name": "ID Pelanggan", "value": "2121212"},
{"name": "ID Pelanggan", "value": "111111111111"},
{"name": "Nama", "value": "TOKOPXXXX UXX"},
{"name": "Total Bayar", "value": "Rp 27.500"},
{"name": "IDPEL", "value": "2121212"},
{"name": "IDPEL", "value": "111111111111"},
{"name": "NAMA", "value": "Tokopedia User Default"},
{"name": "TOTAL TAGIHAN", "value": "1 BULAN"},
{"name": "BL/TH", "value": "MAR20"},
{"name": "RP TAG PLN", "value": "Rp 25.000"},
{"name": "ADMIN BANK", "value": "Rp 2.500"},
{"name": "TOTAL BAYAR", "value": "Rp 27.500"},
],
"meter_id": "2121212",
"meter_id": "111111111111",
"product_code": "pln-postpaid",
"sales_price": 27500,
},
Expand All @@ -303,15 +303,15 @@ def test_inquiry_success_downline_id(

assert response.is_success()
assert response == InquiryResponse(
id="2121212",
id="111111111111",
product_code="pln-postpaid",
sales_price=27500,
fields=[Field(name="optional", value="optional")],
inquiry_result=[
Field(name="ID Pelanggan", value="2121212"),
Field(name="ID Pelanggan", value="111111111111"),
Field(name="Nama", value="TOKOPXXXX UXX"),
Field(name="Total Bayar", value="Rp 27.500"),
Field(name="IDPEL", value="2121212"),
Field(name="IDPEL", value="111111111111"),
Field(name="NAMA", value="Tokopedia User Default"),
Field(name="TOTAL TAGIHAN", value="1 BULAN"),
Field(name="BL/TH", value="MAR20"),
Expand All @@ -322,8 +322,8 @@ def test_inquiry_success_downline_id(
base_price=25000,
admin_fee=2500,
client_name="TOKOPXXXX UXX",
client_number="2121212",
meter_id="2121212",
client_number="111111111111",
meter_id="111111111111",
ref_id="",
max_payment=0,
min_payment=0,
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pip_version = pip==22.0.4
deps =
.[test]
commands =
pytest {posargs: tests}
pytest {posargs: tests} -o log_cli=true -vv

[testenv:lint]
description = Run black to check code formatting
Expand Down
Loading