summaryrefslogtreecommitdiff
path: root/tests/old
diff options
context:
space:
mode:
Diffstat (limited to 'tests/old')
-rw-r--r--tests/old/hashsum_test.data1
-rw-r--r--tests/old/hashsum_test_with_zero.databin7 -> 0 bytes
-rw-r--r--tests/old/test_hashsums.py67
3 files changed, 0 insertions, 68 deletions
diff --git a/tests/old/hashsum_test.data b/tests/old/hashsum_test.data
deleted file mode 100644
index 19102815..00000000
--- a/tests/old/hashsum_test.data
+++ /dev/null
@@ -1 +0,0 @@
-foo \ No newline at end of file
diff --git a/tests/old/hashsum_test_with_zero.data b/tests/old/hashsum_test_with_zero.data
deleted file mode 100644
index 2ec9a6df..00000000
--- a/tests/old/hashsum_test_with_zero.data
+++ /dev/null
Binary files differ
diff --git a/tests/old/test_hashsums.py b/tests/old/test_hashsums.py
deleted file mode 100644
index 0cf6beb7..00000000
--- a/tests/old/test_hashsums.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/python
-
-import unittest
-import apt_pkg
-
-
-class testHashes(unittest.TestCase):
- " test the hashsum functions against strings and files "
-
- def testMD5(self):
- # simple
- s = "foo"
- s_md5 = "acbd18db4cc2f85cedef654fccc4a4d8"
- res = apt_pkg.md5sum(s)
- self.assert_(res == s_md5)
- # file
- res = apt_pkg.md5sum(open("hashsum_test.data"))
- self.assert_(res == s_md5)
- # with zero (\0) in the string
- s = "foo\0bar"
- s_md5 = "f6f5f8cd0cb63668898ba29025ae824e"
- res = apt_pkg.md5sum(s)
- self.assert_(res == s_md5)
- # file
- res = apt_pkg.md5sum(open("hashsum_test_with_zero.data"))
- self.assert_(res == s_md5)
-
- def testSHA1(self):
- # simple
- s = "foo"
- s_hash = "0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33"
- res = apt_pkg.sha1sum(s)
- self.assert_(res == s_hash)
- # file
- res = apt_pkg.sha1sum(open("hashsum_test.data"))
- self.assert_(res == s_hash)
- # with zero (\0) in the string
- s = "foo\0bar"
- s_hash = "e2c300a39311a2dfcaff799528415cb74c19317f"
- res = apt_pkg.sha1sum(s)
- self.assert_(res == s_hash)
- # file
- res = apt_pkg.sha1sum(open("hashsum_test_with_zero.data"))
- self.assert_(res == s_hash)
-
- def testSHA256(self):
- # simple
- s = "foo"
- s_hash = \
- "2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
- res = apt_pkg.sha256sum(s)
- self.assert_(res == s_hash)
- # file
- res = apt_pkg.sha256sum(open("hashsum_test.data"))
- self.assert_(res == s_hash)
- # with zero (\0) in the string
- s = "foo\0bar"
- s_hash = \
- "d6b681bfce7155d44721afb79c296ef4f0fa80a9dd6b43c5cf74dd0f64c85512"
- res = apt_pkg.sha256sum(s)
- self.assert_(res == s_hash)
- # file
- res = apt_pkg.sha256sum(open("hashsum_test_with_zero.data"))
- self.assert_(res == s_hash)
-
-if __name__ == "__main__":
- unittest.main()