Exemple #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")
Exemple #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]
Exemple #6
0
 def test_parse_none(self):
     assert parse_instances(None) is None
     assert parse_instances("") is None
Exemple #7
0
 def test_parse_instances(self):
     instances = '0,1-3,5'
     x = parse_instances(instances)
     assert x == [0, 1, 2, 3, 5]
Exemple #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")
Exemple #9
0
 def test_parse_instances_mixed(self):
     assert parse_instances("4,1-2,0-0") == [0, 1, 2, 4]
Exemple #10
0
 def test_parse_instances_with_range(self):
     assert parse_instances("0-3") == [0, 1, 2, 3]