forked from databricks/databricks-sql-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_init_file.py
More file actions
19 lines (14 loc) · 765 Bytes
/
test_init_file.py
File metadata and controls
19 lines (14 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import hashlib
class TestInitFile:
"""
Micro test to confirm the contents of `databricks/__init__.py` does not change.
Also see https://github.com/databricks/databricks-sdk-py/issues/343#issuecomment-1866029118.
"""
def test_init_file_contents(self):
with open("src/databricks/__init__.py") as f:
init_file_contents = f.read()
# This hash is the expected hash of the contents of `src/databricks/__init__.py`.
# It must not change, or else parallel package installation may lead to clobbered and invalid files.
expected_sha1 = "2772edbf52e517542acf8c039479c4b57b6ca2cd"
actual_sha1 = hashlib.sha1(init_file_contents.encode("utf-8")).hexdigest()
assert expected_sha1 == actual_sha1