fixing TypeError: type of value sent to generator must be str

This commit is contained in:
burnettk 2023-04-20 23:16:45 -04:00
parent 2760319a52
commit 8e9c6cdf3f
2 changed files with 3 additions and 2 deletions

View File

@ -392,7 +392,7 @@ def process_data_show(
)
def _interstitial_stream(process_instance_id: int) -> Generator[str, str, None]:
def _interstitial_stream(process_instance_id: int) -> Generator[str, Optional[str], None]:
process_instance = _find_process_instance_by_id_or_raise(process_instance_id)
processor = ProcessInstanceProcessor(process_instance)
reported_ids = [] # bit of an issue with end tasks showing as getting completed twice.

View File

@ -1694,7 +1694,8 @@ class TestProcessApi(BaseTest):
# Rather that call the API and deal with the Server Side Events, call the loop directly and covert it to
# a list. It tests all of our code. No reason to test Flasks SSE support.
results = list(_interstitial_stream(process_instance_id))
stream_results = _interstitial_stream(process_instance_id)
results = list(stream_results)
# strip the "data:" prefix and convert remaining string to dict.
json_results = list(map(lambda x: json.loads(x[5:]), results)) # type: ignore
# There should be 2 results back -