From a8fe407ace621d39ca2b687a7ccbe4d8e51d9335 Mon Sep 17 00:00:00 2001 From: "Mr. Walls" Date: Tue, 27 Aug 2024 18:59:56 -0700 Subject: [PATCH] [COVERAGE] slight improvement of code coverage Changes in file tests/context.py: def setUpClass(cls): Changes in file tests/test_basic.py: def test_Does_Pass_WHEN_Using_Import_From_Syntax(self): def test_Error_WHEN_the_help_command_is_called(self): --- tests/context.py | 4 ++-- tests/test_basic.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/context.py b/tests/context.py index 2da39a8..a301df6 100644 --- a/tests/context.py +++ b/tests/context.py @@ -579,7 +579,7 @@ def setUp(self): """Overides unittest.TestCase.setUp(unittest.TestCase). Defaults is to skip test if class is missing thepython test fixture. """ - if (self._thepython is None) and (len(self._thepython) <= 0): + if (self._thepython is not None) and (len(self._thepython) <= 0): self.skipTest(str("""No python cmd to test with!""")) @unittest.skipUnless(True, """Insanitty Test. Good luck debugging.""") @@ -590,7 +590,7 @@ def test_absolute_truth_and_meaning(self): def test_finds_python_WHEN_testing(self): """Test case 1: Class Test-Fixture Meta Test.""" - if (self._thepython is None) and (len(self._thepython) <= 0): + if (self._thepython is not None) and (len(self._thepython) <= 0): self.fail(str("""No python cmd to test with!""")) self.test_absolute_truth_and_meaning() diff --git a/tests/test_basic.py b/tests/test_basic.py index 42e784b..a9e83cb 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -74,8 +74,7 @@ def test_Error_WHEN_the_help_command_is_called(self): try: from .context import multicast self.assertIsNotNone(multicast.__name__) - if multicast.__name__ is None: - theResult = False + theResult = (multicast.__name__ is not None) with self.assertRaises(Exception): raise RuntimeError("This is a test") with self.assertRaises(Exception): @@ -90,8 +89,7 @@ def test_IsNone_WHEN_given_corner_case_input(self): theResult = False try: from .context import multicast - if multicast.__name__ is None: - theResult = False + theResult = (multicast.__name__ is not None) from multicast import __main__ as multicast tst_dispatch = multicast.McastDispatch() test_junk_values = [None, "JunkInput", "--Junk"]