Skip to content

Commit eff783a

Browse files
[PATCH] Apply suggested changes from review (- WIP #168 -)
Changes in file tests/test_fuzz.py: - minor style changes
1 parent 28d8be7 commit eff783a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

tests/test_fuzz.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,23 @@ def test_multicast_sender_with_random_data(self, data):
124124
@given(st.text(alphabet=string.ascii_letters + string.digits, min_size=3, max_size=15))
125125
@settings(deadline=None)
126126
def test_invalid_Error_WHEN_cli_called_GIVEN_invalid_fuzz_input(self, text):
127-
"""Test case template for invalid fuzzed input to multicast CLI."""
127+
"""
128+
Test the multicast CLI's response to invalid fuzzed input.
129+
130+
This test case uses Hypothesis to generate random strings of ASCII letters
131+
and digits, then passes them as arguments to the multicast CLI. It verifies
132+
that the CLI correctly identifies and reports these as invalid inputs.
133+
134+
Args:
135+
text (str): A randomly generated string of ASCII letters and digits,
136+
with length between 3 and 15 characters.
137+
138+
Assertions:
139+
- The CLI output contains "invalid choice:" message
140+
- The CLI output includes the invalid input text
141+
"""
128142
theResult = False
143+
fail_fixture = str("""XZY? --> Multicast != error""")
129144
if (self._thepython is not None):
130145
try:
131146
args = [
@@ -147,7 +162,7 @@ def test_invalid_Error_WHEN_cli_called_GIVEN_invalid_fuzz_input(self, text):
147162
err = None
148163
del err # skipcq - cleanup any error leaks early
149164
theResult = False
150-
assert theResult
165+
self.assertTrue(theResult, fail_fixture)
151166

152167

153168
if __name__ == '__main__':

0 commit comments

Comments
 (0)