def test_int_tuple(self): a = zn.Set((1, 2, 3)) assert isinstance(a, SetPar) assert a.value == (1, 2, 3)
def __init__(self, ): self.a = zn.Set(zn.var(zn.range(5))) self.b = zn.Set(zn.range(10))
def test_name(self, name, arg): a = zn.Set(arg) a._name = name assert name == to_str(a)
def test_wrong_type(self, arg): with pytest.raises(ValueError, match="Unsupported type for set: <class"): zn.Set(arg)
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)
def test_int_range(self, collection): a = zn.Set(collection) assert isinstance(a, SetPar) assert a.value == collection