Skip to content

Commit

Permalink
Make tests pass on Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lubomir committed Oct 31, 2019
1 parent 2ff0775 commit f6d73c9
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions tests/test_extra_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f6d73c9

Please sign in to comment.