Beispiel #1
0
 def test_int_tuple(self):
     a = zn.Set((1, 2, 3))
     assert isinstance(a, SetPar)
     assert a.value == (1, 2, 3)
Beispiel #2
0
 def __init__(self, ):
     self.a = zn.Set(zn.var(zn.range(5)))
     self.b = zn.Set(zn.range(10))
Beispiel #3
0
 def test_name(self, name, arg):
     a = zn.Set(arg)
     a._name = name
     assert name == to_str(a)
Beispiel #4
0
 def test_wrong_type(self, arg):
     with pytest.raises(ValueError,
                        match="Unsupported type for set: <class"):
         zn.Set(arg)
Beispiel #5
0
 def test_int_generator(self):
     a = zn.Set((a + 1 for a in range(4)))
     assert isinstance(a, SetPar)
     assert a.value == (1, 2, 3, 4)
Beispiel #6
0
 def test_int_range(self, collection):
     a = zn.Set(collection)
     assert isinstance(a, SetPar)
     assert a.value == collection