예제 #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]