Jon Herron 883e65384f Squashed 'spiffworkflow-backend/' content from commit 50f28073
git-subtree-dir: spiffworkflow-backend
git-subtree-split: 50f28073add91265f00826bd175c8b2fff76cdc5
2022-10-12 10:22:22 -04:00

28 lines
757 B
Python

"""Test_file."""
from datetime import datetime
from spiffworkflow_backend.models.file import File
def test_files_can_be_sorted() -> None:
"""Test_files_can_be_sorted."""
europe = create_test_file(type="bpmn", name="europe")
asia = create_test_file(type="bpmn", name="asia")
africa = create_test_file(type="dmn", name="africa")
oceania = create_test_file(type="dmn", name="oceania")
mylist = [europe, oceania, asia, africa]
assert sorted(mylist) == [asia, europe, africa, oceania]
def create_test_file(type: str, name: str) -> File:
"""Create_test_file."""
return File(
type=type,
name=name,
content_type=type,
document={},
last_modified=datetime.now(),
size=1,
)