From b091abdc917c2eca544e5928b85b2bb9270912b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 31 Oct 2019 14:25:18 +0100 Subject: [PATCH] Make tests pass on Python 2.6 --- tests/test_extra_files.py | 43 ++++++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/tests/test_extra_files.py b/tests/test_extra_files.py index 54115e9..7848fd9 100755 --- a/tests/test_extra_files.py +++ b/tests/test_extra_files.py @@ -63,28 +63,51 @@ def _test_identity(self, modules): def test_bad_checksums(self): metadata = ExtraFiles() - with self.assertRaises(TypeError): - metadata.add("Everything", "x86_64", "path/to/file", size=1, checksums="no") + self.assertRaises( + TypeError, + metadata.add, + "Everything", + "x86_64", + "path/to/file", + size=1, + checksums="no", + ) def test_bad_variant(self): metadata = ExtraFiles() - with self.assertRaises(ValueError): - metadata.add("", "x86_64", "path/to/file", size=1, checksums={}) + self.assertRaises( + ValueError, metadata.add, "", "x86_64", "path/to/file", size=1, checksums={} + ) def test_bad_arch(self): metadata = ExtraFiles() - with self.assertRaises(ValueError): - metadata.add("Everything", "foobar", "path/to/file", size=1, checksums={}) + self.assertRaises( + ValueError, + metadata.add, + "Everything", + "foobar", + "path/to/file", + size=1, + checksums={}, + ) def test_bad_path(self): metadata = ExtraFiles() - with self.assertRaises(ValueError): - metadata.add("Everything", "foobar", "", size=1, checksums={}) + self.assertRaises( + ValueError, metadata.add, "Everything", "foobar", "", size=1, checksums={} + ) def test_absolute_path(self): metadata = ExtraFiles() - with self.assertRaises(ValueError): - metadata.add("Everything", "foobar", "/path", size=1, checksums={}) + self.assertRaises( + ValueError, + metadata.add, + "Everything", + "foobar", + "/path", + size=1, + checksums={}, + ) def test_fedora_20(self): metadata = ExtraFiles()