Example #1
0
 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)
Example #2
0
 def test_set_place_bind(self):
     config = recv.ChunkStreamConfig(place=place_bind_llc)
     assert config.place == place_bind_llc
Example #3
0
 def test_set_place_non_capsule(self):
     with pytest.raises(TypeError):
         recv.ChunkStreamConfig(place=(1, ))
Example #4
0
 def test_set_place_empty_tuple(self):
     with pytest.raises(IndexError):
         recv.ChunkStreamConfig(place=())
Example #5
0
 def test_set_place_none(self):
     config = recv.ChunkStreamConfig(place=None)
     assert config.place is None
Example #6
0
 def test_zero_max_chunks(self):
     config = recv.ChunkStreamConfig()
     with pytest.raises(ValueError):
         config.max_chunks = 0
Example #7
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