Beispiel #1
0
 def test_parse_none(self):
   assert parse_instances(None) is None
   assert parse_instances("") is None
  def test_parse_instances_invalid_ranges(self):
    with pytest.raises(ArgumentTypeError):
      parse_instances("4-1")

    with pytest.raises(ArgumentTypeError):
      parse_instances("1-0")
Beispiel #3
0
 def test_parse_instances(self):
   instances = '0,1-3,5'
   x = parse_instances(instances)
   assert x == [0, 1, 2, 3, 5]
 def test_parse_instances_with_range(self):
   assert parse_instances("0-3") == [0, 1, 2, 3]
 def test_parse_instances_mixed(self):
   assert parse_instances("4,1-2,0-0") == [0, 1, 2, 4]
Beispiel #6
0
 def test_parse_none(self):
     assert parse_instances(None) is None
     assert parse_instances("") is None
Beispiel #7
0
 def test_parse_instances(self):
     instances = '0,1-3,5'
     x = parse_instances(instances)
     assert x == [0, 1, 2, 3, 5]
Beispiel #8
0
    def test_parse_instances_invalid_ranges(self):
        with pytest.raises(ArgumentTypeError):
            parse_instances("4-1")

        with pytest.raises(ArgumentTypeError):
            parse_instances("1-0")
Beispiel #9
0
 def test_parse_instances_mixed(self):
     assert parse_instances("4,1-2,0-0") == [0, 1, 2, 4]
Beispiel #10
0
 def test_parse_instances_with_range(self):
     assert parse_instances("0-3") == [0, 1, 2, 3]