summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2015-05-22 12:12:47 +0200
committerMichael Vogt <mvo@ubuntu.com>2015-05-22 12:12:47 +0200
commit83d876034f5bd74f007376f2cefc98cae77a5a94 (patch)
treeb9bd765d40e2cbaf654f58bb01bdeb8dda3c39a6 /tests
parent39e58a1efcf45fa06e9cc87790f5c8883f157039 (diff)
downloadpython-apt-83d876034f5bd74f007376f2cefc98cae77a5a94.tar.gz
rename "md5" keyword argument in AcquireFile() to "hash" and add backward compatiblity
Diffstat (limited to 'tests')
-rw-r--r--tests/test_paths.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_paths.py b/tests/test_paths.py
index 51d22f49..993ad02b 100644
--- a/tests/test_paths.py
+++ b/tests/test_paths.py
@@ -35,6 +35,20 @@ class TestPath(unittest.TestCase):
destdir=self.file_unicode,
destfile=self.file_unicode)
+ def test_acquire_file_md5_keyword_backward_compat(self):
+ """
+ Ensure that both "md5" and "hash" is supported as keyword for
+ AcquireFile
+ """
+ apt_pkg.AcquireFile(
+ apt_pkg.Acquire(), "http://example.com",
+ destfile=self.file_bytes,
+ md5="abcdef")
+ apt_pkg.AcquireFile(
+ apt_pkg.Acquire(), "http://example.com",
+ destfile=self.file_bytes,
+ hash="sha1:41050ed528554fdd6c6c9a086ddd6bdba5857b21")
+
def test_ararchive(self):
archive = apt_inst.ArArchive(u"data/test_debs/data-tar-xz.deb")