diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_paths.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/test_paths.py b/tests/test_paths.py index 222848f7..d647e6e2 100644 --- a/tests/test_paths.py +++ b/tests/test_paths.py @@ -42,13 +42,17 @@ class TestPath(unittest.TestCase): AcquireFile """ with warnings.catch_warnings(record=True) as caught_warnings: + warnings.simplefilter("always") apt_pkg.AcquireFile( apt_pkg.Acquire(), "http://example.com", destfile=self.file_bytes, md5="abcdef") - assert len(caught_warnings) == 1 - assert issubclass(caught_warnings[0].category, DeprecationWarning) + self.assertEqual(len(caught_warnings), 1) + self.assertTrue(issubclass(caught_warnings[0].category, + DeprecationWarning)) + self.assertIn("md5", str(caught_warnings[0].message)) + self.assertIn("hash", str(caught_warnings[0].message)) apt_pkg.AcquireFile( apt_pkg.Acquire(), "http://example.com", |
