Exemplo n.º 1
0
 def test_parse_none(self):
   assert parse_instances(None) is None
   assert parse_instances("") is None
Exemplo n.º 2
0
  def test_parse_instances_invalid_ranges(self):
    with pytest.raises(ArgumentTypeError):
      parse_instances("4-1")

    with pytest.raises(ArgumentTypeError):
      parse_instances("1-0")
Exemplo n.º 3
0
 def test_parse_instances(self):
   instances = '0,1-3,5'
   x = parse_instances(instances)
   assert x == [0, 1, 2, 3, 5]
Exemplo n.º 4
0
 def test_parse_instances_with_range(self):
   assert parse_instances("0-3") == [0, 1, 2, 3]
Exemplo n.º 5
0
 def test_parse_instances_mixed(self):
   assert parse_instances("4,1-2,0-0") == [0, 1, 2, 4]
Exemplo n.º 6
0
 def test_parse_none(self):
     assert parse_instances(None) is None
     assert parse_instances("") is None
Exemplo n.º 7
0
 def test_parse_instances(self):
     instances = '0,1-3,5'
     x = parse_instances(instances)
     assert x == [0, 1, 2, 3, 5]
Exemplo n.º 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")
Exemplo n.º 9
0
 def test_parse_instances_mixed(self):
     assert parse_instances("4,1-2,0-0") == [0, 1, 2, 4]
Exemplo n.º 10
0
 def test_parse_instances_with_range(self):
     assert parse_instances("0-3") == [0, 1, 2, 3]