Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 5ffde97

Browse files
committed
fix tests
1 parent 8b0257e commit 5ffde97

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

data_diff/databases/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from data_diff.databases.base import MD5_HEXDIGITS, CHECKSUM_HEXDIGITS, QueryError, ConnectError, BaseDialect, Database
2+
from data_diff.databases.base import CHECKSUM_OFFSET
23
from data_diff.databases._connect import connect as connect
34
from data_diff.databases._connect import Connect as Connect
45
from data_diff.databases.postgresql import PostgreSQL as PostgreSQL

tests/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ def str_to_checksum(str: str):
124124
# hello world
125125
# => 5eb63bbbe01eeed093cb22bb8f5acdc3
126126
# => cb22bb8f5acdc3
127-
# => 273350391345368515
127+
# => 273350391345368515 - offset (see db.CHECKSUM_OFFSET)
128128
m = hashlib.md5()
129129
m.update(str.encode("utf-8")) # encode to binary
130130
md5 = m.hexdigest()
131131
# 0-indexed, unlike DBs which are 1-indexed here, so +1 in dbs
132132
half_pos = db.MD5_HEXDIGITS - db.CHECKSUM_HEXDIGITS
133-
return int(md5[half_pos:], 16)
133+
return int(md5[half_pos:], 16) - db.CHECKSUM_OFFSET
134134

135135

136136
class DiffTestCase(unittest.TestCase):

0 commit comments

Comments
 (0)