def test_cross_999_native_implementation_decompress(self): """Tests the native implementation against the Python implementation (assuming this one works)""" if not env_use_native(): self.skipTest("This test is only enabled when the native implementations are tested.") py_cls = self.handler().load_python_model() rs_cls = self.handler().load_native_model() result_py = py_cls.compress(FIX).to_bytes() self.assertEqual( FIX, rs_cls(result_py).decompress(), "The rust implementation mus decompress correctly." )
def test_cross_native_implementation_decompress(self, _, in_bytes): """Tests the native implementation against the Python implementation -- Using the main dataset.""" if not env_use_native(): self.skipTest( "This test is only enabled when the native implementations are tested." ) py_cls = self.handler().load_python_model() rs_cls = self.handler().load_native_model() result_py = py_cls.compress(in_bytes).to_bytes() self.assertEqual(in_bytes, rs_cls(result_py).decompress(), "The rust implementation mus decompress correctly.")
def test_cross_native_implementation_compress(self, _, in_bytes): """Tests the native implementation against the Python implementation (assuming this one works) -- Using the main dataset.""" if not env_use_native(): self.skipTest( "This test is only enabled when the native implementations are tested." ) py_cls = self.handler().load_python_model() rs_cls = self.handler().load_native_model() result_rs = rs_cls.compress(in_bytes).to_bytes() self.assertEqual( in_bytes, bytes(py_cls(result_rs).decompress()), "The rust implementation mus compress correctly, so the Python implementation " "can correctly decompress it again.")