Skip to content

Commit d29014e

Browse files
[PATCH] Apply suggestions from code review (- WIP PR #348 -)
1 parent 4765e03 commit d29014e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

multicast/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
True
246246
>>>
247247
248-
Testcase 1: Multicast should have a default and valid buffer size.
248+
Testcase 1: Multicast should validate buffer size constraints.
249249
A: Test that the _MCAST_DEFAULT_BUFFER_SIZE attribute is initialized.
250250
B: Test that the _MCAST_DEFAULT_BUFFER_SIZE attribute is an int.
251251
C: Test that the _MCAST_DEFAULT_BUFFER_SIZE attribute is RFC-791 & RFC-768 compliant.

multicast/env.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def validate_buffer_size(size: int) -> bool:
120120
False
121121
>>> validate_buffer_size(-1) # Negative is invalid
122122
False
123-
>>> validate_buffer_size(65527) # Maximum UDP payload size 65,535-8 - RFC 791 & RFC 768
123+
>>> validate_buffer_size(65507) # Maximum UDP payload size 65,535 -8 -20 (RFC-791 & RFC-768)
124124
True
125125
>>> validate_buffer_size("1316") # String that can be converted
126126
True
@@ -133,7 +133,7 @@ def validate_buffer_size(size: int) -> bool:
133133
"""
134134
try:
135135
size_num = int(size)
136-
return 0 < size_num <= 65527
136+
return 0 < size_num <= 65507
137137
except (ValueError, TypeError) as err:
138138
raise ValueError(f"Invalid buffer size value: {size}. Must be a positive integer.") from err
139139

@@ -828,7 +828,7 @@ def load_config() -> dict:
828828
>>> with warnings.catch_warnings(record=True) as w:
829829
... warnings.simplefilter("always")
830830
... config = load_config()
831-
... len(w) == 1 # expected failure - Warning was issued
831+
... len(w) == 1 # expected warning was issued
832832
True
833833
>>> config['buffer_size'] == _MCAST_DEFAULT_BUFFER_SIZE # Falls back to default
834834
True

0 commit comments

Comments
 (0)