summaryrefslogtreecommitdiffstats
path: root/tests/test_sips2.py
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2016-02-01 16:59:01 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2016-02-01 17:40:46 (GMT)
commitf69e313ce3d42130f1d3b8c9f95d9965e16dd60d (patch)
tree8a0c570b849dd04e5b14dfbac4e7f62ad6dcae64 /tests/test_sips2.py
parent1d659b1b2148f24569838d7669cb691296890a0d (diff)
downloadeopayment-f69e313ce3d42130f1d3b8c9f95d9965e16dd60d.zip
eopayment-f69e313ce3d42130f1d3b8c9f95d9965e16dd60d.tar.gz
eopayment-f69e313ce3d42130f1d3b8c9f95d9965e16dd60d.tar.bz2
refactor tests around py.test
Diffstat (limited to 'tests/test_sips2.py')
-rw-r--r--tests/test_sips2.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_sips2.py b/tests/test_sips2.py
new file mode 100644
index 0000000..b641c11
--- /dev/null
+++ b/tests/test_sips2.py
@@ -0,0 +1,13 @@
+import pytest
+import pprint
+
+import eopayment
+
+def test_build_request():
+ backend = eopayment.Payment('sips2', {})
+ assert backend.request(amount='12')
+
+def test_parse_response():
+ qs = '''Data=captureDay%3D0%7CcaptureMode%3DAUTHOR_CAPTURE%7CcurrencyCode%3D978%7CmerchantId%3D002001000000001%7CorderChannel%3DINTERNET%7CresponseCode%3D00%7CtransactionDateTime%3D2016-02-01T17%3A44%3A20%2B01%3A00%7CtransactionReference%3D668930%7CkeyVersion%3D1%7CacquirerResponseCode%3D00%7Camount%3D1200%7CauthorisationId%3D12345%7CcardCSCResultCode%3D4E%7CpanExpiryDate%3D201605%7CpaymentMeanBrand%3DMASTERCARD%7CpaymentMeanType%3DCARD%7CcustomerIpAddress%3D82.244.203.243%7CmaskedPan%3D5100%23%23%23%23%23%23%23%23%23%23%23%2300%7CorderId%3Dd4903de7027f4d56ac01634fd7ab9526%7CholderAuthentRelegation%3DN%7CholderAuthentStatus%3D3D_ERROR%7CtransactionOrigin%3DINTERNET%7CpaymentPattern%3DONE_SHOT&Seal=6ca3247765a19b45d25ad54ef4076483e7d55583166bd5ac9c64357aac097602&InterfaceVersion=HP_2.0&Encode='''
+ backend = eopayment.Payment('sips2', {})
+ assert backend.response(qs)