fix: preserve Arr metadata and fail closed
This commit is contained in:
parent
82b14a0732
commit
e23374e24b
1 changed files with 31 additions and 0 deletions
31
fileflows/tests/test_flow_import_failure_routing.py
Normal file
31
fileflows/tests/test_flow_import_failure_routing.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import json
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
FLOW = Path(__file__).parents[1] / "flow" / "flow_auto_movie_pipeline.json"
|
||||
|
||||
|
||||
class FlowImportFailureRoutingTests(unittest.TestCase):
|
||||
def test_arr_import_failures_route_to_fail_flow(self):
|
||||
flow = json.loads(FLOW.read_text())
|
||||
fail_node = next(
|
||||
part
|
||||
for part in flow["Parts"]
|
||||
if part.get("FlowElementUid") == "FileFlows.BasicNodes.Functions.FailFlow"
|
||||
)
|
||||
import_nodes = [
|
||||
part
|
||||
for part in flow["Parts"]
|
||||
if part.get("Name")
|
||||
in {"Sonarr - Trigger Manual Import", "Radarr - Trigger Manual Import"}
|
||||
]
|
||||
|
||||
self.assertEqual(len(import_nodes), 4)
|
||||
for node in import_nodes:
|
||||
with self.subTest(node=node["Uid"]):
|
||||
self.assertEqual(node["ErrorConnection"]["InputNode"], fail_node["Uid"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue