Skip to content

Commit 24e6e5e

Browse files
authored
Merge pull request #4 from tokopedia:f_fixing_test
fix(sdk): Fixing test
2 parents 70b14f3 + 9f5e83e commit 24e6e5e

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

tests/conftest.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import enum
2+
import logging
23
import os
34
import random
45
import string
@@ -123,8 +124,10 @@ def __construct_sandbox_test_config():
123124
@pytest.fixture(scope="session")
124125
def sat_config(make_httpserver: HTTPServer, env: TestEnvironment):
125126
if env == TestEnvironment.LOCAL:
127+
logging.info("Using local test config")
126128
return __construct_local_test_config(make_httpserver)
127129
elif env == TestEnvironment.SANDBOX:
130+
logging.info("Using sandbox test config")
128131
return __construct_sandbox_test_config()
129132
else:
130133
raise ValueError(f"Invalid environment: {env}")

tests/test_inquiry.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -263,26 +263,26 @@ def test_inquiry_success_downline_id(
263263
response_json={
264264
"data": {
265265
"type": "inquiry",
266-
"id": "2121212",
266+
"id": "111111111111",
267267
"attributes": {
268268
"admin_fee": 2500,
269269
"base_price": 25000,
270270
"client_name": "TOKOPXXXX UXX",
271-
"client_number": "2121212",
271+
"client_number": "111111111111",
272272
"fields": [{"name": "optional", "value": "optional"}],
273273
"inquiry_result": [
274-
{"name": "ID Pelanggan", "value": "2121212"},
274+
{"name": "ID Pelanggan", "value": "111111111111"},
275275
{"name": "Nama", "value": "TOKOPXXXX UXX"},
276276
{"name": "Total Bayar", "value": "Rp 27.500"},
277-
{"name": "IDPEL", "value": "2121212"},
277+
{"name": "IDPEL", "value": "111111111111"},
278278
{"name": "NAMA", "value": "Tokopedia User Default"},
279279
{"name": "TOTAL TAGIHAN", "value": "1 BULAN"},
280280
{"name": "BL/TH", "value": "MAR20"},
281281
{"name": "RP TAG PLN", "value": "Rp 25.000"},
282282
{"name": "ADMIN BANK", "value": "Rp 2.500"},
283283
{"name": "TOTAL BAYAR", "value": "Rp 27.500"},
284284
],
285-
"meter_id": "2121212",
285+
"meter_id": "111111111111",
286286
"product_code": "pln-postpaid",
287287
"sales_price": 27500,
288288
},
@@ -303,15 +303,15 @@ def test_inquiry_success_downline_id(
303303

304304
assert response.is_success()
305305
assert response == InquiryResponse(
306-
id="2121212",
306+
id="111111111111",
307307
product_code="pln-postpaid",
308308
sales_price=27500,
309309
fields=[Field(name="optional", value="optional")],
310310
inquiry_result=[
311-
Field(name="ID Pelanggan", value="2121212"),
311+
Field(name="ID Pelanggan", value="111111111111"),
312312
Field(name="Nama", value="TOKOPXXXX UXX"),
313313
Field(name="Total Bayar", value="Rp 27.500"),
314-
Field(name="IDPEL", value="2121212"),
314+
Field(name="IDPEL", value="111111111111"),
315315
Field(name="NAMA", value="Tokopedia User Default"),
316316
Field(name="TOTAL TAGIHAN", value="1 BULAN"),
317317
Field(name="BL/TH", value="MAR20"),
@@ -322,8 +322,8 @@ def test_inquiry_success_downline_id(
322322
base_price=25000,
323323
admin_fee=2500,
324324
client_name="TOKOPXXXX UXX",
325-
client_number="2121212",
326-
meter_id="2121212",
325+
client_number="111111111111",
326+
meter_id="111111111111",
327327
ref_id="",
328328
max_payment=0,
329329
min_payment=0,

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pip_version = pip==22.0.4
1515
deps =
1616
.[test]
1717
commands =
18-
pytest {posargs: tests}
18+
pytest {posargs: tests} -o log_cli=true -vv
1919

2020
[testenv:lint]
2121
description = Run black to check code formatting

0 commit comments

Comments
 (0)