File tree 2 files changed +28
-2
lines changed
2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -87,3 +87,22 @@ def flow(expdb_test: Connection) -> Flow:
87
87
)
88
88
(flow_id ,) = expdb_test .execute (text ("""SELECT LAST_INSERT_ID();""" )).one ()
89
89
return Flow (id = flow_id , name = "name" , external_version = "external_version" )
90
+
91
+
92
+ @pytest .fixture ()
93
+ def persisted_flow (flow : Flow , expdb_test : Connection ) -> Iterator [Flow ]:
94
+ expdb_test .commit ()
95
+ yield flow
96
+ # We want to ensure the commit below does not accidentally persist new
97
+ # data to the database.
98
+ expdb_test .rollback ()
99
+ expdb_test .execute (
100
+ text (
101
+ """
102
+ DELETE FROM implementation
103
+ WHERE id = :flow_id
104
+ """ ,
105
+ ),
106
+ parameters = {"flow_id" : flow .id },
107
+ )
108
+ expdb_test .commit ()
Original file line number Diff line number Diff line change 9
9
)
10
10
from starlette .testclient import TestClient
11
11
12
+ from tests .conftest import Flow
12
13
14
+
15
+ @pytest .mark .mut ()
13
16
@pytest .mark .php ()
14
- def test_flow_exists (py_api : TestClient , php_api : TestClient ) -> None :
15
- path = "exists/weka.ZeroR/Weka_3.9.0_12024"
17
+ def test_flow_exists (
18
+ persisted_flow : Flow ,
19
+ py_api : TestClient ,
20
+ php_api : TestClient ,
21
+ ) -> None :
22
+ path = f"exists/{ persisted_flow .name } /{ persisted_flow .external_version } "
16
23
py_response = py_api .get (f"/flows/{ path } " )
17
24
php_response = php_api .get (f"/flow/{ path } " )
18
25
You can’t perform that action at this time.
0 commit comments