Exemplo n.º 1
0
 def test_repr(self):
     res = t.Iterable(t.ToInt)
     assert repr(res) == '<List(<ToInt>)>'
     res = t.Iterable(t.Int, min_length=0, max_length=10)
     assert repr(res) == '<List(max_length=10 | <Int>)>'
     res = t.Iterable(t.Int, min_length=1, max_length=10)
     assert repr(res) == '<List(min_length=1, max_length=10 | <Int>)>'
Exemplo n.º 2
0
 def test_iterable(self):
     res = extract_error(t.Iterable(t.ToInt), 1)
     assert res == 'value is not iterable'