summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-01-31 09:59:26 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2012-01-31 09:59:26 (GMT)
commit4f0def0fd37bff3321895ef00271501d1172468e (patch)
treec2f3b45f338bbc90e64ffcd0337d5ee7db552772 /tests
parent40a4e5ffa1b18d128cd3f0a244eabfbfb552870a (diff)
downloadeopayment-4f0def0fd37bff3321895ef00271501d1172468e.zip
eopayment-4f0def0fd37bff3321895ef00271501d1172468e.tar.gz
eopayment-4f0def0fd37bff3321895ef00271501d1172468e.tar.bz2
add unit tests for spplus module
Diffstat (limited to 'tests')
-rw-r--r--tests/__init__.py0
-rw-r--r--tests/spplus.py15
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/__init__.py
diff --git a/tests/spplus.py b/tests/spplus.py
new file mode 100644
index 0000000..d28f2da
--- /dev/null
+++ b/tests/spplus.py
@@ -0,0 +1,15 @@
+from unittest import TestCase
+import eopayment.spplus as spplus
+
+class SPPlustTest(TestCase):
+ ntkey = '58 6d fc 9c 34 91 9b 86 3f ' \
+ 'fd 64 63 c9 13 4a 26 ba 29 74 1e c7 e9 80 79'
+
+ tests = [('x=coin', 'c04f8266d6ae3ce37551cce996c751be4a95d10a'),
+ ('x=coin&y=toto', 'ef008e02f8dbf5e70e83da416b0b3a345db203de')]
+
+ def test_spplus(self):
+ payment = spplus.Payment({'cle': self.ntkey, 'siret': '00000000000001-01'})
+
+ for query, result in self.tests:
+ self.assertEqual(spplus.sign_ntkey_query(self.ntkey, query).lower(), result)