• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

reactive-firewall-org / multicast / 16954025989

14 Aug 2025 02:00AM UTC coverage: 97.128%. Remained the same
16954025989

push

github

reactive-firewall
[HOTFIX] Fix for CI-CD regression

Changes in file .github/workflows/CI-CHGLOG.yml:
 * hotfix for regression of download-artifacts action logic after version bump

127 of 133 branches covered (95.49%)

Branch coverage included in aggregate %.

2173 of 2235 relevant lines covered (97.23%)

6.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.44
/tests/test_basic.py
1
#! /usr/bin/env python3
2
# -*- coding: utf-8 -*-
3

4
# Python Test Repo Template
5
# ..................................
6
# Copyright (c) 2017-2025, Mr. Walls
7
# ..................................
8
# Licensed under MIT (the "License");
9
# you may not use this file except in compliance with the License.
10
# You may obtain a copy of the License at
11
# ..........................................
12
# https://github.com/reactive-firewall/python-repo/blob/HEAD/LICENSE.md
13
# ..........................................
14
# Unless required by applicable law or agreed to in writing, software
15
# distributed under the License is distributed on an "AS IS" BASIS,
16
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
# See the License for the specific language governing permissions and
18
# limitations under the License.
19

20
__module__ = "tests"
4✔
21

22
try:
4✔
23
        try:
4✔
24
                import context
4✔
25
        except Exception as _root_cause:  # pragma: no branch
26
                del _root_cause  # skipcq - cleanup any error leaks early
27
                from . import context
28
        if not hasattr(context, '__name__') or not context.__name__:  # pragma: no branch
4✔
29
                raise ImportError("[CWE-758] Failed to import context") from None
30
        else:
31
                from context import sys
4✔
32
                from context import unittest
4✔
33
except Exception as _cause:  # pragma: no branch
34
        raise ImportError("[CWE-758] Failed to import test context") from _cause
35

36

37
@context.markWithMetaTag("mat", "basic")
4✔
38
class BasicTestSuite(context.BasicUsageTestSuite):
4✔
39
        """
40
        A test suite containing basic test cases for the multicast module.
41

42
        This class inherits from context.BasicUsageTestSuite and provides a set of
43
        unit tests to verify the fundamental functionality and error handling of
44
        the multicast module.
45

46
        Test Methods:
47
        - test_absolute_truth_and_meaning: An insanity test that always passes.
48
        - test_Does_Pass_WHEN_Meta_Test: Verifies basic assertion methods.
49
        - test_Does_Pass_WHEN_Using_Import_From_Syntax: Tests importing the multicast module.
50
        - test_Error_WHEN_the_help_command_is_called: Checks if the --help option raises an exception.
51
        - test_IsNone_WHEN_given_corner_case_input: Tests handling of invalid inputs.
52
        - test_None_WHEN_Nothing: A placeholder for additional tests.
53
        - test_Skip_UNLESS_linux_only: A test that only runs on Linux platforms.
54
        - test_Skip_UNLESS_darwin_only: A test that only runs on macOS platforms.
55

56
        Note:
57
        Some tests are conditionally skipped based on the operating system.
58
        The test methods use various assertion techniques to verify expected behaviors.
59

60
        This test suite is designed to catch basic issues and ensure the core
61
        functionality of the multicast module works as expected across different
62
        platforms.
63
        """
64

65
        __module__ = "tests.test_basic"
4✔
66

67
        @unittest.skipUnless(__debug__, "Insanity Test. Good luck debugging.")
4✔
68
        def test_absolute_truth_and_meaning(self):
4✔
69
                """Insanity Test 1: Because it only matters if we're not mad as hatters."""
70
                assert True
4✔
71

72
        @unittest.skipUnless(__debug__, "Insanity Test. Good luck debugging.")
4✔
73
        def test_Does_Pass_WHEN_Meta_Test(self):
4✔
74
                """Insanity Test 2: for unittests assertion."""
75
                self.assertTrue(True)  # skipcq: PYL-W1503 - obviously this is an Insanity Test!
4✔
76
                self.assertFalse(False)  # skipcq: PYL-W1503 - obviously this is an Insanity Test!
4✔
77
                self.assertIsNone(None)  # skipcq: PYL-W1503 - obviously this is an Insanity Test!
4✔
78
                self.test_absolute_truth_and_meaning()
4✔
79
                self.test_None_WHEN_Nothing()
4✔
80

81
        @unittest.skipUnless(__debug__, "Insanity Test. Good luck debugging.")
4✔
82
        def test_None_WHEN_Nothing(self):
4✔
83
                """Insanity Test 3: indirect call for unittests assertion."""
84
                self.assertIsNone(None)  # skipcq: PYL-W1503 - obviously this is an Insanity Test!
4✔
85
                # define new tests below
86

87
        def test_Does_Pass_WHEN_Using_Import_From_Syntax(self):
4✔
88
                """Test case 0: importing multicast."""
89
                theResult = False
4✔
90
                try:
4✔
91
                        from .context import multicast
4✔
92
                        self.assertIsNotNone(multicast.__name__)
4✔
93
                        self.assertIsNotNone(multicast.__module__)
4✔
94
                        self.assertIsNotNone(multicast.__doc__)
4✔
95
                        theResult = True
4✔
96
                except Exception as _cause:
97
                        context.debugtestError(_cause)
98
                        theResult = False
99
                self.assertTrue(theResult)
4✔
100

101
        def test_Error_WHEN_the_help_command_is_called(self):
4✔
102
                """Test case 1: the --help options should error when called."""
103
                theResult = False
4✔
104
                try:
4✔
105
                        from .context import multicast
4✔
106
                        self.assertIsNotNone(multicast.__name__)
4✔
107
                        theResult = (multicast.__name__ is not None)
4✔
108
                        with self.assertRaises(Exception):
4✔
109
                                raise RuntimeError("This is a test")
4✔
110
                        with self.assertRaises(Exception):
4✔
111
                                multicast.main(["--help"])
4✔
112
                        theResult = True
4✔
113
                except Exception:
114
                        theResult = False  # suppress non-testing errors
115
                self.assertTrue(theResult)
4✔
116

117
        def test_IsNone_WHEN_given_corner_case_input(self):
4✔
118
                """Test case 2: Example for bad input directly into function."""
119
                theResult = False
4✔
120
                try:
4✔
121
                        from .context import multicast
4✔
122
                        theResult = (multicast.__name__ is not None)
4✔
123
                        from multicast import __main__ as multicast
4✔
124
                        tst_dispatch = multicast.McastDispatch()
4✔
125
                        test_junk_values = [None, "JunkInput", "--Junk"]
4✔
126
                        for tst_in in test_junk_values:
4✔
127
                                (_ignored_code, test_fixture) = tst_dispatch.useTool(tst_in)
4✔
128
                                self.assertIsNone(
4✔
129
                                        test_fixture,
130
                                        f"multicast.McastDispatch().useTool({str(tst_in)}) == ERROR"
131
                                )
132
                        theResult = True
4✔
133
                except Exception:
134
                        theResult = False
135
                self.assertTrue(theResult)
4✔
136

137
        @unittest.skipUnless(sys.platform.startswith("linux"), "This test example requires linux")
4✔
138
        def test_Skip_UNLESS_linux_only(self):
4✔
139
                """Linux is the test."""
140
                self.assertTrue(sys.platform.startswith("linux"))
4✔
141

142
        @unittest.skipUnless(sys.platform.startswith("darwin"), "This test example requires macOS")
4✔
143
        def test_Skip_UNLESS_darwin_only(self):
4✔
144
                """MacOS is the test."""
145
                self.assertTrue(sys.platform.startswith("darwin"))
×
146

147

148
# leave this part
149
if __name__ == '__main__':
150
        unittest.main()
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc