From 4ac29da334ff60d089b2e14c1f3da23b08fa7d2a Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Mon, 24 Jun 2019 13:55:38 -0400 Subject: [PATCH] Assert that RuntimeErrors have correct messages Related: rhbz#1709594 Signed-off-by: Brian C. Lane --- tests/pylorax/test_gitrpm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/pylorax/test_gitrpm.py b/tests/pylorax/test_gitrpm.py index 04411b1b..49093a4f 100644 --- a/tests/pylorax/test_gitrpm.py +++ b/tests/pylorax/test_gitrpm.py @@ -111,9 +111,10 @@ class GitArchiveTest(unittest.TestCase): ref="v1.1.0" destination="/srv/testing-rpm/" """ % ("/tmp/no-repo-here/")) - with self.assertRaises(RuntimeError): + with self.assertRaises(RuntimeError) as e: archive = GitArchiveTarball(git_repo["repos"]["git"][0]) self._check_tar(archive, "git-rpm-test/", None) + self.assertIn("Failed to clone", str(e.exception)) def git_fail_ref_test(self): """Test creating an archive from a bad ref""" @@ -127,9 +128,10 @@ class GitArchiveTest(unittest.TestCase): ref="0297617d7b8baa263a69ae7dc901bbbcefd0eaa4" destination="/srv/testing-rpm/" """ % (self.repodir)) - with self.assertRaises(RuntimeError): + with self.assertRaises(RuntimeError) as e: archive = GitArchiveTarball(git_repo["repos"]["git"][0]) self._check_tar(archive, "git-rpm-test/", None) + self.assertIn("Failed to archive", str(e.exception)) class GitRpmTest(unittest.TestCase):