Commit 9822558d authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Add None in expected

parent c05f9ec7
......@@ -35,30 +35,30 @@ def sender_streams():
def test_get_next_by_date(receiver_streams, sender_streams):
stream = receiver_streams[0]['name']
expected = ['2', '1', '3', '4', '5']
for i in range(5):
expected = ['2', '1', '3', '4', '5', None]
for expected_stream in expected:
stream = get_new_stream(stream, receiver_streams, receiver_streams,
sender_stream_list=sender_streams, naming_scheme='date')
assert stream == expected[i]
assert stream == expected_stream
def test_get_next_by_number(receiver_streams, sender_streams):
stream = receiver_streams[1]['name']
expected = ['2', '3', '4', '5', None]
for i in range(5):
for expected_stream in expected:
stream = get_new_stream(stream, receiver_streams, receiver_streams,
sender_stream_list=sender_streams, naming_scheme='numeric')
assert stream == expected[i]
assert stream == expected_stream
def test_get_next_by_name(receiver_streams, sender_streams):
stream = receiver_streams[0]['name']
expected = ['4', '5', None, None, None]
for i in range(5):
for expected_stream in expected:
stream = get_new_stream(stream, receiver_streams, receiver_streams,
sender_stream_list=sender_streams, naming_scheme='basename')
sender_streams += [x for x in receiver_streams if x['name'] == stream]
assert stream == expected[i]
assert stream == expected_stream
if stream is None:
break
......@@ -66,14 +66,14 @@ def test_get_next_by_name(receiver_streams, sender_streams):
def test_get_next_by_name_nonfinished(receiver_streams, sender_streams):
stream = receiver_streams[0]['name']
expected = ['3', '4', '5', None, None]
for i in range(5):
for expected_stream in expected:
new_stream = get_new_stream(stream, receiver_streams, receiver_streams,
sender_stream_list=sender_streams, naming_scheme='basename_nonfinished')
finished_stream = [x for x in receiver_streams if x['name'] == stream]
finished_stream[0]['finished'] = True
sender_streams += finished_stream
stream = new_stream
assert stream == expected[i]
assert stream == expected_stream
if stream is None:
break
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment