def test_invalid(self): prop = bcpc.Array(Float) assert not prop.is_valid(False) assert not prop.is_valid(True) assert not prop.is_valid(0) assert not prop.is_valid(1) assert not prop.is_valid(0.0) assert not prop.is_valid(1.0) assert not prop.is_valid(1.0 + 1.0j) assert not prop.is_valid("") assert not prop.is_valid(()) assert not prop.is_valid([]) assert not prop.is_valid({}) assert not prop.is_valid(_TestHasProps()) assert not prop.is_valid(_TestModel())
def test_str(self): prop = bcpc.Array(Float) assert str(prop) == "Array(Float)"
def test_has_ref(self): prop = bcpc.Array(Float) assert not prop.has_ref
def test_valid(self): prop = bcpc.Array(Float) assert prop.is_valid(None) assert prop.is_valid(np.array([1, 2, 3]))
def test_init(self): with pytest.raises(TypeError): bcpc.Array()