File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
services/director-v2/tests/unit/with_dbs/comp_scheduler Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,24 @@ async def test_list(
107107 await CompRunsRepository (aiopg_engine ).list (), key = lambda x : x .iteration
108108 ) == sorted (created , key = lambda x : x .iteration )
109109
110+ # test with filter of state
111+ any_state_but_published = {
112+ s for s in RunningState if s is not RunningState .PUBLISHED
113+ }
114+ assert (
115+ await CompRunsRepository (aiopg_engine ).list (
116+ filter_by_state = any_state_but_published
117+ )
118+ == []
119+ )
120+
121+ assert sorted (
122+ await CompRunsRepository (aiopg_engine ).list (
123+ filter_by_state = {RunningState .PUBLISHED }
124+ ),
125+ key = lambda x : x .iteration ,
126+ ) == sorted (created , key = lambda x : x .iteration )
127+
110128
111129async def test_create (
112130 aiopg_engine ,
You can’t perform that action at this time.
0 commit comments