mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-03-01 09:30:46 +00:00
b8924100d Merge pull request #165 from sartography/feature/more_launch_buttons_and_dropdowns eae9d4e37 Merge remote-tracking branch 'origin/main' into feature/more_launch_buttons_and_dropdowns 704ce5709 pyl is passing 98e1776ed When returning the list of files in a ProcessModel, include all the ways they can be referenced, for instance, json files, can be referened by file name, bpmn files can be referened by one more process ids, and DMN's files can be referenced by one or more decision ids. This information is now included in the reference. git-subtree-dir: spiffworkflow-backend git-subtree-split: b8924100d01276e3f282dbe939df74ebabdad625
27 lines
736 B
Python
27 lines
736 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,
|
|
last_modified=datetime.now(),
|
|
size=1,
|
|
)
|