Пример #1
0
 def test_parse_position_input_fail_missing_dash():
     assert parse_position_input("10 21,32,43") is None
Пример #2
0
 def test_parse_position_input_fail_missing_range_end():
     assert parse_position_input("10 -") is None
Пример #3
0
 def test_parse_position_input_fail_empty_string():
     assert parse_position_input("") is None
Пример #4
0
 def test_parse_position_input_fail_missing_comma():
     assert parse_position_input("10,21,32 43") is None
Пример #5
0
 def test_parse_position_sorted_output():
     unsorted_positions = '10, 32, 21, 43'
     assert parse_position_input(unsorted_positions) == [10, 21, 32, 43]
Пример #6
0
 def test_parse_position_with_period():
     assert parse_position_input('10. 32. 21. 43') is None
Пример #7
0
 def test_parse_position_input_test_5():
     positions5 = "10-21"
     assert parse_position_input(positions5) == [
         10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21
     ]
Пример #8
0
 def test_parse_position_input_test_4():
     positions4 = "10 - 21, 32, 43"
     assert parse_position_input(positions4) == [
         10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 32, 43
     ]
Пример #9
0
 def test_parse_position_input_3():
     positions3 = "10-16"
     assert parse_position_input(positions3) == [
         10, 11, 12, 13, 14, 15, 16
     ]
Пример #10
0
 def test_parse_position_input_2():
     positions2 = '10,21,32,43'
     assert parse_position_input(positions2) == [10, 21, 32, 43]
Пример #11
0
 def test_parse_position_input_1():
     positions1 = '10, 21, 32, 43'
     assert parse_position_input(positions1) == [10, 21, 32, 43]