示例#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]