Skip to content

Commit b57f91e

Browse files
authored
Fixed color test function that was not correctly updating the color to check(#54)
1 parent 0318b37 commit b57f91e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test_suite.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_ownership_receivers(child_sub, samples_sent, timeout):
127127
index = child_sub.expect(
128128
[
129129
'\[[0-9]+\]', # index = 0
130-
pexpect.TIMEOUT # index = 1
130+
pexpect.TIMEOUT, # index = 1
131131
],
132132
timeout
133133
)
@@ -186,14 +186,16 @@ def test_color_receivers(child_sub, samples_sent, timeout):
186186
"""
187187
sub_string = re.search('\w\s+(\w+)\s+[0-9]+ [0-9]+ \[[0-9]+\]',
188188
child_sub.before + child_sub.after)
189-
last_color = current_color = sub_string.group(1)
189+
first_sample_color = sub_string.group(1)
190190

191191
max_samples_received = MAX_SAMPLES_READ
192192
samples_read = 0
193193

194194
while sub_string is not None and samples_read < max_samples_received:
195+
current_sample_color = sub_string.group(1)
196+
195197
# Check that all received samples have the same color
196-
if last_color != current_color:
198+
if current_sample_color != first_sample_color:
197199
return ReturnCode.RECEIVING_FROM_BOTH
198200

199201
index = child_sub.expect(

0 commit comments

Comments
 (0)