File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 88import six
99
1010from splitio .engine import hashfns , splitters
11+ from splitio .engine .hashfns .murmur3py import hash128_x64 as murmur3_128_py
1112from splitio .models import splits
1213
1314
@@ -101,3 +102,17 @@ def test_murmur128(self):
101102 seed = int (seed )
102103 hashed = int (hashed )
103104 assert hashfns .murmur_128 (key , seed ) == hashed
105+
106+ def test_murmur128_pure_python (self ):
107+ """Test legacy hash function against known results."""
108+ file_name = os .path .join (os .path .dirname (__file__ ), 'files' , 'murmur128_test_suite.csv' )
109+ with io .open (file_name , 'r' , encoding = 'utf-8' ) as flo :
110+ lines = flo .read ().split ('\n ' )
111+
112+ for line in lines :
113+ if line is None or line == '' :
114+ continue
115+ key , seed , hashed = line .split (',' )
116+ seed = int (seed )
117+ hashed = int (hashed )
118+ assert murmur3_128_py (key , seed ) == hashed
You can’t perform that action at this time.
0 commit comments