From 378099cc105daa5cdca2016340402972252b062d Mon Sep 17 00:00:00 2001 From: Sophia Fondell Date: Thu, 14 Jun 2018 16:05:01 -0400 Subject: [PATCH] Fixing bug where test did not try to import pylorax.version to check for version but automatically just checked for 'devel' causing test to fail when it should not have --- tests/pylorax/test_buildstamp.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/pylorax/test_buildstamp.py b/tests/pylorax/test_buildstamp.py index 73959ad1..6a6873a9 100644 --- a/tests/pylorax/test_buildstamp.py +++ b/tests/pylorax/test_buildstamp.py @@ -22,4 +22,9 @@ class BuildStampTestCase(unittest.TestCase): self.bstamp.write('/tmp/stamp.ini') self.assertIn("[Main]\nProduct=Lorax Tests\nVersion=0.1\nBugURL=https://github.com/rhinstaller/lorax/issues\nIsFinal=True\n", out_file.getvalue()) # Skip UUID which is between IsFinal and Variant - self.assertIn("Variant=Server\n[Compose]\nLorax=devel", out_file.getvalue()) + try: + import pylorax.version + except ImportError: + self.assertIn("Variant=Server\n[Compose]\nLorax=devel", out_file.getvalue()) + else: + self.assertIn("Variant=Server\n[Compose]\nLorax=" + pylorax.version.num, out_file.getvalue())