Skip to content

Commit 850ddb8

Browse files
committed
Improve 'validate_otdf_python.py'
1 parent 7abe4cb commit 850ddb8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

validate_otdf_python.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
from otdf_python.gotdf_python import EncryptionConfig
1111

12-
SOME_PLAINTEXT_FILE = Path(__file__).parent / "go.mod"
13-
1412

1513
def verify_hello():
1614
from otdf_python.gotdf_python import Hello
@@ -81,6 +79,9 @@ def verify_encrypt_file() -> None:
8179
"The output path should not exist before calling 'EncryptFile()'."
8280
)
8381

82+
SOME_PLAINTEXT_FILE = Path(tmpDir) / "new-file.txt"
83+
SOME_PLAINTEXT_FILE.write_text("Hello world")
84+
8485
outputFilePath = EncryptFile(
8586
inputFilePath=str(SOME_PLAINTEXT_FILE),
8687
outputFilePath=str(SOME_ENCRYPTED_FILE),
@@ -91,10 +92,10 @@ def verify_encrypt_file() -> None:
9192
if not SOME_ENCRYPTED_FILE.exists():
9293
raise ValueError("The output file does not exist!")
9394

94-
if not (
95-
SOME_ENCRYPTED_FILE.stat().st_size > 2500
96-
and is_zipfile(SOME_ENCRYPTED_FILE)
97-
):
95+
encrypted_file_size = SOME_ENCRYPTED_FILE.stat().st_size
96+
print(f"The encrypted file size is {encrypted_file_size}")
97+
98+
if not (encrypted_file_size > 1500 and is_zipfile(SOME_ENCRYPTED_FILE)):
9899
raise ValueError("The output file has unexpected content!")
99100

100101
# breakpoint()

0 commit comments

Comments
 (0)