Skip to content

Commit

Permalink
add serialization test for symlink model file
Browse files Browse the repository at this point in the history
Signed-off-by: Spencer Schrock <sschrock@google.com>
  • Loading branch information
spencerschrock committed Jul 23, 2024
1 parent 19a1d45 commit df87666
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions model_signing/serialization/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

"""Test fixtures to share between tests. Not part of the public API."""

import os
import pathlib
import pytest

from model_signing.serialization import test_support
Expand Down Expand Up @@ -102,3 +104,12 @@ def deep_model_folder(tmp_path_factory):
file.write_text(f"This is file f{i}.")

return model_root

@pytest.fixture
def symlink_model_file(tmp_path_factory: pytest.TempPathFactory) -> pathlib.Path:
"""A model with a symlink to a single file."""
source_file = tmp_path_factory.mktemp("source") / "file"
source_file.write_bytes(test_support.KNOWN_MODEL_TEXT)
symlink_file = tmp_path_factory.mktemp("symlink") / "file"
os.symlink(source_file.absolute(), symlink_file.absolute())
return symlink_file
1 change: 1 addition & 0 deletions model_signing/serialization/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"empty_model_file",
"empty_model_folder",
"model_folder_with_empty_file",
"symlink_model_file",
]


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3aab065c7181a173b5dd9e9d32a9f79923440b413be1e1ffcdba26a7365f719b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.:3aab065c7181a173b5dd9e9d32a9f79923440b413be1e1ffcdba26a7365f719b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14aebf2e466ad30ef59ea6fce67de44dc133c673784bd543b45f75b8efc3d821
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
beb3cbbd9d73133e85a102a3cbda2ef1dc2bc61e9323e32e576e4adb0571bf86
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.:0:22:3aab065c7181a173b5dd9e9d32a9f79923440b413be1e1ffcdba26a7365f719b
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.:0:8:a37010c994067764d86540bf479d93b4d0c3bb3955de7b61f951caf2fd0301b0
.:8:16:bd762002a3528a27fb9a8822f822b949d3c9ab7e860af33039c9aa70ebbbe682
.:16:22:a791e1e893ea4260c77475725101fb4cc6ad85f6340f21f10b239184e318cd21

0 comments on commit df87666

Please sign in to comment.