summaryrefslogtreecommitdiff
path: root/debian/patches/move_testvectors_outside_site-packages.patch
blob: 956370c3808d88f7764cfd08ee47250d10adc931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# moves testvecoros (i.e. non .py files) outside site-packages
Index: pycryptopp-0.5.29/pycryptopp/test/__init__.py
===================================================================
--- /dev/null
+++ pycryptopp-0.5.29/pycryptopp/test/__init__.py
@@ -0,0 +1,7 @@
+import os
+
+def resource_string(package_or_requirement, resource_name):
+    return file(os.path.join("/usr/share/python-pycryptopp/%s" % resource_name)).read()
+
+def resource_listdir(package_or_requirement, resource_name):
+    return os.listdir("/usr/share/python-pycryptopp/%s" % resource_name)
Index: pycryptopp-0.5.29/pycryptopp/test/test_aes.py
===================================================================
--- pycryptopp-0.5.29.orig/pycryptopp/test/test_aes.py
+++ pycryptopp-0.5.29/pycryptopp/test/test_aes.py
@@ -11,7 +11,7 @@ VERBOSE=False
 
 from pycryptopp.cipher import aes
 
-from pkg_resources import resource_string, resource_listdir
+from pycryptopp.test import resource_string, resource_listdir
 
 from base64 import b32encode
 def ab(x): # debuggery
Index: pycryptopp-0.5.29/pycryptopp/test/test_sha256.py
===================================================================
--- pycryptopp-0.5.29.orig/pycryptopp/test/test_sha256.py
+++ pycryptopp-0.5.29/pycryptopp/test/test_sha256.py
@@ -11,7 +11,7 @@ VERBOSE=False
 
 from pycryptopp.hash import sha256
 
-from pkg_resources import resource_string
+from pycryptopp.test import resource_string
 
 def resource_string_lines(pkgname, resname):
     return split_on_newlines(resource_string(pkgname, resname))