Esempio n. 1
0
 def test_dump_float32_raises_mismatch_error_on_mismatch(self):
     with pytest.raises(BinarySizeMismatch, match=_MISMATCH_DUMP_REGEX):
         dump_float32(3.4e39)
     with pytest.raises(BinarySizeMismatch, match=_MISMATCH_DUMP_REGEX):
         dump_float32(-3.4e39)
Esempio n. 2
0
 def test_dump_float32_raises_type_error_on_invalid_type(self):
     with pytest.raises(TypeError, match=_TYPE_ERROR_DUMP_REGEX):
         dump_float32(_INVALID)
Esempio n. 3
0
 def test_dump_float32_raises_type_error_on_none(self):
     with pytest.raises(TypeError, match=_TYPE_ERROR_DUMP_REGEX):
         dump_float32(None)
Esempio n. 4
0
 def test_dump_float32_big(self):
     assert dump_float32(_FLOAT32, ByteOrder.BIG) == _FLOAT32_BYTES_BIG
Esempio n. 5
0
 def test_dump_float32_little(self):
     assert dump_float32(
         _FLOAT32, ByteOrder.LITTLE) == _FLOAT32_BYTES_LITTLE
Esempio n. 6
0
 def test_dump_float32(self):
     assert dump_float32(_FLOAT32) == _FLOAT32_BYTES