Skip to content

Commit c17d7fa

Browse files
[TESTING] minor fixes for regression in test coverage
1 parent 5e3f5da commit c17d7fa

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

multicast/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def __init__(self, *args, **kwargs):
319319
320320
Testcase 3: Invalid message type.
321321
322-
>>> exc = ShutdownCommandReceived(123) # doctest: +IGNORE_EXCEPTION_DETAIL
322+
>>> exc = ShutdownCommandReceived(message=123) # doctest: +IGNORE_EXCEPTION_DETAIL
323323
Traceback (most recent call last):
324324
TypeError: message must be a string
325325

tests/test_exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_shutdown_received_error_with_args(self):
101101
"""
102102
error = multicast.exceptions.ShutdownCommandReceived("Test Shutdown", 42)
103103
self.assertEqual(error.message, "Test Shutdown")
104-
self.assertIsNotEqual(error.exit_code, 42, "Unexpectedly was able to overide exit code!")
104+
self.assertNotEqual(error.exit_code, 42, "Unexpectedly was able to override exit code!")
105105
self.assertEqual(error.exit_code, 143)
106106

107107
def test_shutdown_received_error_default_exit_code(self):
@@ -135,7 +135,7 @@ def test_shutdown_received_error_with_cause(self):
135135
self.assertIsNotNone(error.__cause__)
136136
self.assertEqual(error.__cause__, test_cause)
137137
self.assertEqual(error.message, "Shutdown with cause")
138-
self.assertIsNotEqual(error.exit_code, 77, "Unexpectedly was able to overide exit code!")
138+
self.assertNotEqual(error.exit_code, 77, "Unexpectedly was able to override exit code!")
139139
self.assertEqual(error.exit_code, 143)
140140

141141

tests/test_usage.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,12 @@ def test_say_works_WHEN_using_stdin(self):
443443
test_input = "Test message from stdin"
444444
self.assertIsNotNone(test_input)
445445
with patch('sys.stdin', io.StringIO(test_input)):
446-
self.assertIsNotNone(say.doStep(data=['-'], group='224.0.0.1', port=_fixture_port_num))
447-
# Assert that the result is as expected
448-
# You might need to modify this based on what _sayStep returns
449-
theResult = True # or whatever the expected output is
446+
result = say.doStep(data=['-'], group='224.0.0.1', port=_fixture_port_num)
447+
self.assertIsNotNone(result)
448+
# Verify the message was actually sent
449+
theResult = result.success
450+
self.assertTrue(theResult) # Assuming there's a success indicator
451+
self.assertEqual(result.sent_message, test_input) # Verify message content
450452
except Exception as err:
451453
context.debugtestError(err)
452454
self.skipTest(fail_fixture)

0 commit comments

Comments
 (0)