def test_set_place_bad_signature(self): place = scipy.LowLevelCallable(place_plain.ctypes, signature='void (void)') # One might expect TypeError, but ValueError is what scipy uses for # invalid signatures. with pytest.raises(ValueError): recv.ChunkStreamConfig(place=place)
def test_set_place_bind(self): config = recv.ChunkStreamConfig(place=place_bind_llc) assert config.place == place_bind_llc
def test_set_place_non_capsule(self): with pytest.raises(TypeError): recv.ChunkStreamConfig(place=(1, ))
def test_set_place_empty_tuple(self): with pytest.raises(IndexError): recv.ChunkStreamConfig(place=())
def test_set_place_none(self): config = recv.ChunkStreamConfig(place=None) assert config.place is None
def test_zero_max_chunks(self): config = recv.ChunkStreamConfig() with pytest.raises(ValueError): config.max_chunks = 0
def test_default_construct(self): config = recv.ChunkStreamConfig() assert config.items == [] assert config.max_chunks == config.DEFAULT_MAX_CHUNKS assert config.place is None assert config.packet_presence_payload_size == 0