fix mypy typing stuff. w/ jasquat
This commit is contained in:
parent
d748f019e8
commit
b63693514a
|
@ -3,7 +3,7 @@ from dataclasses import dataclass
|
||||||
|
|
||||||
from flask_bpmn.models.db import db
|
from flask_bpmn.models.db import db
|
||||||
from flask_bpmn.models.db import SpiffworkflowBaseDBModel
|
from flask_bpmn.models.db import SpiffworkflowBaseDBModel
|
||||||
from flask_marshmallow import Schema
|
from flask_marshmallow import Schema # type: ignore
|
||||||
from marshmallow import INCLUDE
|
from marshmallow import INCLUDE
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class SpecReferenceCache(SpiffworkflowBaseDBModel):
|
||||||
is_primary = db.Column(db.Boolean())
|
is_primary = db.Column(db.Boolean())
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_spec_reference(cls, ref):
|
def from_spec_reference(cls, ref: SpecReference) -> "SpecReferenceCache":
|
||||||
"""From_spec_reference."""
|
"""From_spec_reference."""
|
||||||
return cls(
|
return cls(
|
||||||
identifier=ref.identifier,
|
identifier=ref.identifier,
|
||||||
|
@ -63,7 +63,7 @@ class SpecReferenceCache(SpiffworkflowBaseDBModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SpecReferenceSchema(Schema):
|
class SpecReferenceSchema(Schema): # type: ignore
|
||||||
"""FileSchema."""
|
"""FileSchema."""
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -339,9 +339,12 @@ def process_model_list(
|
||||||
return Response(json.dumps(response_json), status=200, mimetype="application/json")
|
return Response(json.dumps(response_json), status=200, mimetype="application/json")
|
||||||
|
|
||||||
|
|
||||||
def process_list() -> any:
|
def process_list() -> Any:
|
||||||
"""Returns a list of all known processes - this includes processes that are not the
|
"""Returns a list of all known processes.
|
||||||
primary process - helpful for finding possible call activities."""
|
|
||||||
|
This includes processes that are not the
|
||||||
|
primary process - helpful for finding possible call activities.
|
||||||
|
"""
|
||||||
references = SpecReferenceCache.query.filter_by(type="process")
|
references = SpecReferenceCache.query.filter_by(type="process")
|
||||||
return SpecReferenceSchema(many=True).dump(references)
|
return SpecReferenceSchema(many=True).dump(references)
|
||||||
|
|
||||||
|
|
|
@ -61,13 +61,6 @@ class SpecFileService(FileSystemService):
|
||||||
ref_map[ref.identifier] = ref
|
ref_map[ref.identifier] = ref
|
||||||
return ref_map
|
return ref_map
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_references(process_models: List[ProcessModelInfo]) -> list[SpecReference]:
|
|
||||||
"""Returns all references -- process_ids, and decision ids, across all process models provided."""
|
|
||||||
references = []
|
|
||||||
for process_model in process_models:
|
|
||||||
references.extend(SpecFileService.get_references_for_process(process_model))
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_references_for_process(
|
def get_references_for_process(
|
||||||
process_model_info: ProcessModelInfo,
|
process_model_info: ProcessModelInfo,
|
||||||
|
|
|
@ -446,9 +446,8 @@ class TestProcessApi(BaseTest):
|
||||||
client: FlaskClient,
|
client: FlaskClient,
|
||||||
with_db_and_bpmn_file_cleanup: None,
|
with_db_and_bpmn_file_cleanup: None,
|
||||||
with_super_admin_user: UserModel,
|
with_super_admin_user: UserModel,
|
||||||
):
|
) -> None:
|
||||||
"""It should be possible to get a list of all processes known to the system."""
|
"""It should be possible to get a list of all processes known to the system."""
|
||||||
|
|
||||||
load_test_spec(
|
load_test_spec(
|
||||||
"test_group_one/simple_form",
|
"test_group_one/simple_form",
|
||||||
process_model_source_directory="simple_form",
|
process_model_source_directory="simple_form",
|
||||||
|
@ -480,9 +479,9 @@ class TestProcessApi(BaseTest):
|
||||||
)
|
)
|
||||||
assert simple_form["display_name"] == "Process With Form"
|
assert simple_form["display_name"] == "Process With Form"
|
||||||
assert simple_form["process_model_id"] == "test_group_one/simple_form"
|
assert simple_form["process_model_id"] == "test_group_one/simple_form"
|
||||||
assert simple_form["has_lanes"] == False
|
assert simple_form["has_lanes"] is False
|
||||||
assert simple_form["is_executable"] == True
|
assert simple_form["is_executable"] is True
|
||||||
assert simple_form["is_primary"] == True
|
assert simple_form["is_primary"] is True
|
||||||
|
|
||||||
def test_process_group_add(
|
def test_process_group_add(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Reference in New Issue