Skip to content

Commit c3e31f4

Browse files
committed
Fix decorator order
1 parent deb2b66 commit c3e31f4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/tests/plugins/test_rest_plugin.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ async def test_on_run_apply_plugin_service_uri_not_set(self):
101101
CustomApplyPolicy()
102102

103103
@pytest.mark.asyncio
104-
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
105104
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
106105
@pytest.mark.parametrize(
107106
"spec", ["run_spec", "fleet_spec", "volume_spec", "gateway_spec"], indirect=True
108107
)
108+
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
109109
async def test_on_apply_plugin_service_returns_mutated_spec(
110110
self, test_db, user, project, spec
111111
):
@@ -125,23 +125,23 @@ async def test_on_apply_plugin_service_returns_mutated_spec(
125125
assert result == type(spec)(**response_dict["spec"])
126126

127127
@pytest.mark.asyncio
128-
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
129128
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
130129
@pytest.mark.parametrize(
131130
"spec", ["run_spec", "fleet_spec", "volume_spec", "gateway_spec"], indirect=True
132131
)
132+
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
133133
async def test_on_apply_plugin_service_call_fails(self, test_db, user, project, spec):
134134
policy = CustomApplyPolicy()
135135
with mock.patch("requests.post", side_effect=requests.RequestException("fail")):
136136
with pytest.raises(ServerClientError):
137137
policy.on_apply(user=user.name, project=project.name, spec=spec)
138138

139139
@pytest.mark.asyncio
140-
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
141140
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
142141
@pytest.mark.parametrize(
143142
"spec", ["run_spec", "fleet_spec", "volume_spec", "gateway_spec"], indirect=True
144143
)
144+
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
145145
async def test_on_apply_plugin_service_connection_fails(self, test_db, user, project, spec):
146146
policy = CustomApplyPolicy()
147147
with mock.patch(
@@ -151,11 +151,11 @@ async def test_on_apply_plugin_service_connection_fails(self, test_db, user, pro
151151
policy.on_apply(user=user.name, project=project.name, spec=spec)
152152

153153
@pytest.mark.asyncio
154-
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
155154
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
156155
@pytest.mark.parametrize(
157156
"spec", ["run_spec", "fleet_spec", "volume_spec", "gateway_spec"], indirect=True
158157
)
158+
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
159159
async def test_on_apply_plugin_service_returns_invalid_spec(
160160
self, test_db, user, project, spec
161161
):
@@ -168,7 +168,6 @@ async def test_on_apply_plugin_service_returns_invalid_spec(
168168
policy.on_apply(user.name, project=project.name, spec=spec)
169169

170170
@pytest.mark.asyncio
171-
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
172171
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
173172
@pytest.mark.parametrize(
174173
"spec", ["run_spec", "fleet_spec", "volume_spec", "gateway_spec"], indirect=True
@@ -193,6 +192,7 @@ async def test_on_apply_plugin_service_returns_invalid_spec(
193192
),
194193
],
195194
)
195+
@mock.patch.dict(os.environ, {PLUGIN_SERVICE_URI_ENV_VAR_NAME: "http://mock"})
196196
async def test_on_apply_plugin_service_error_handling(
197197
self, test_db, user, project, spec, error, expectation
198198
):

0 commit comments

Comments
 (0)