From 998d0140beae7e4b6caca07a3d8c86cec0b9c8c0 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 --- 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 74b14e4d..975f2921 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):