mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
✨ add tests for Bundle
This commit is contained in:
parent
184753a304
commit
575f9c6244
2 changed files with 46 additions and 3 deletions
|
|
@ -17,8 +17,8 @@ pre-commit = "^4.0.0"
|
|||
clique = "^2"
|
||||
pyblish-base = "^1.8"
|
||||
attrs = "^24.2.0"
|
||||
mypy = "==1.15.0"
|
||||
pydantic-core = "==2.29.0"
|
||||
speedcopy = "^2.0.0"
|
||||
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
|
|
@ -31,7 +31,7 @@ ruff = "^0.9.3"
|
|||
pre-commit = "^4"
|
||||
codespell = "^2.2.6"
|
||||
semver = "^3.0.2"
|
||||
mypy = "^1.14.0"
|
||||
mypy = "==1.15.0"
|
||||
|
||||
|
||||
[tool.ruff]
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ from ayon_api.operations import (
|
|||
)
|
||||
from ayon_core.pipeline.anatomy import Anatomy
|
||||
from ayon_core.pipeline.traits import (
|
||||
Bundle,
|
||||
FileLocation,
|
||||
FileLocations,
|
||||
FrameRanged,
|
||||
|
|
@ -177,6 +178,44 @@ def mock_context(
|
|||
pixel_aspect_ratio=1.0),
|
||||
MimeType(mime_type="image/png"),
|
||||
]),
|
||||
Representation(name="test_bundle", traits=[
|
||||
Persistent(),
|
||||
Bundle(
|
||||
items=[
|
||||
[
|
||||
FileLocation(
|
||||
file_path=single_file,
|
||||
file_size=len(base64.b64decode(PNG_FILE_B64))),
|
||||
Image(),
|
||||
MimeType(mime_type="image/png"),
|
||||
],
|
||||
[
|
||||
Persistent(),
|
||||
FrameRanged(
|
||||
frame_start=1,
|
||||
frame_end=SEQUENCE_LENGTH,
|
||||
frame_in=0,
|
||||
frame_out=SEQUENCE_LENGTH - 1,
|
||||
frames_per_second="25",
|
||||
),
|
||||
Sequence(
|
||||
frame_padding=4,
|
||||
frame_regex=re.compile(
|
||||
r"img\.(?P<index>(?P<padding>0*)\d{4})\.png$"),
|
||||
),
|
||||
FileLocations(
|
||||
file_paths=file_locations,
|
||||
),
|
||||
Image(),
|
||||
PixelBased(
|
||||
display_window_width=1920,
|
||||
display_window_height=1080,
|
||||
pixel_aspect_ratio=1.0),
|
||||
MimeType(mime_type="image/png"),
|
||||
],
|
||||
],
|
||||
),
|
||||
]),
|
||||
]
|
||||
|
||||
return context
|
||||
|
|
@ -289,4 +328,8 @@ def test_get_transfers_from_representation(
|
|||
transfers = integrator.get_transfers_from_representations(
|
||||
instance, representations)
|
||||
|
||||
assert len(transfers) == 11
|
||||
assert len(representations) == 3
|
||||
assert len(transfers) == 22
|
||||
|
||||
for transfer in transfers:
|
||||
...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue