From 83d876034f5bd74f007376f2cefc98cae77a5a94 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 22 May 2015 12:12:47 +0200 Subject: rename "md5" keyword argument in AcquireFile() to "hash" and add backward compatiblity --- tests/test_paths.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') 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") -- cgit v1.2.3