python-productmd/139.patch
Troy Dawson 47c3922198 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/python-productmd#951412fd6a6ec5a7ee444cabb261687384fcfab5
2020-10-14 19:41:04 -07:00

76 lines
2.5 KiB
Diff

From b091abdc917c2eca544e5928b85b2bb9270912b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
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()