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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
Description: Add override teardDown() function to cleanup directory after tests. This will avoid
dirty tree module at installation time
Author: Josue Ortega <josue@debian.org>
Last-Update: 2019-12-30
Forwarded: not-needed
--- a/src/ecdsa/test_pyecdsa.py
+++ b/src/ecdsa/test_pyecdsa.py
@@ -55,6 +55,11 @@
class ECDSA(unittest.TestCase):
+
+ def tearDown(self):
+ if os.path.isdir("t"):
+ shutil.rmtree("t")
+
def test_basic(self):
priv = SigningKey.generate()
pub = priv.get_verifying_key()
@@ -957,6 +962,10 @@
class DER(unittest.TestCase):
+ def tearDown(self):
+ if os.path.isdir("t"):
+ shutil.rmtree("t")
+
def test_integer(self):
self.assertEqual(der.encode_integer(0), b("\x02\x01\x00"))
self.assertEqual(der.encode_integer(1), b("\x02\x01\x01"))
@@ -1018,6 +1027,11 @@
class Util(unittest.TestCase):
+
+ def tearDown(self):
+ if os.path.isdir("t"):
+ shutil.rmtree("t")
+
def test_trytryagain(self):
tta = util.randrange_from_seed__trytryagain
for i in range(1000):
@@ -1058,6 +1072,9 @@
class RFC6979(unittest.TestCase):
+ def tearDown(self):
+ if os.path.isdir("t"):
+ shutil.rmtree("t")
# https://tools.ietf.org/html/rfc6979#appendix-A.1
def _do(self, generator, secexp, hsh, hash_func, expected):
actual = rfc6979.generate_k(generator.order(), secexp, hash_func, hsh)
@@ -1196,6 +1213,10 @@
class ECDH(unittest.TestCase):
+ def tearDown(self):
+ if os.path.isdir("t"):
+ shutil.rmtree("t")
+
def _do(self, curve, generator, dA, x_qA, y_qA, dB, x_qB, y_qB, x_Z, y_Z):
qA = dA * generator
qB = dB * generator
|