File tree 2 files changed +39
-0
lines changed
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,32 @@ def test_cancel_by_merchant_uid(iamport):
35
35
assert e .message == u'취소할 결제건이 존재하지 않습니다.'
36
36
37
37
38
+ def test_cancel_without_merchant_uid (iamport ):
39
+ payload = {
40
+ 'merchant_uid' : None ,
41
+ 'reason' : 'any-reason' ,
42
+ }
43
+
44
+ try :
45
+ iamport .cancel (** payload )
46
+ except KeyError as e :
47
+ assert 'merchant_uid or imp_uid is required' in str (e )
48
+
49
+
50
+ def test_cancel_by_merchant_uid_with_kwargs (iamport ):
51
+ payload = {
52
+ 'merchant_uid' : 'any-merchant_uid' ,
53
+ 'reason' : 'any-reason' ,
54
+ 'amount' : 1234 ,
55
+ }
56
+
57
+ try :
58
+ iamport .cancel (** payload )
59
+ except iamport .ResponseError as e :
60
+ assert e .code == 1
61
+ assert e .message == u'취소할 결제건이 존재하지 않습니다.'
62
+
63
+
38
64
def test_cancel_by_imp_uid (iamport ):
39
65
payload = {
40
66
'imp_uid' : 'any-imp_uid' ,
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+
4
+ def test_is_paid_with_response (iamport ):
5
+ mocked_response = {
6
+ 'status' : 'paid' ,
7
+ 'amount' : 1000 ,
8
+ }
9
+ assert True is iamport .is_paid (amount = 1000 , resposne = mocked_response , merchant_uid = 'test' )
10
+
11
+
12
+ def test_is_paid_without_response (iamport ):
13
+ assert False is iamport .is_paid (amount = 1000 , merchant_uid = 'qwer1234' )
You can’t perform that action at this time.
0 commit comments