Skip to content

Commit 8ad997e

Browse files
ISSUE #92 - Remove unittest_run_loop
1 parent 5f5cfdd commit 8ad997e

File tree

4 files changed

+0
-34
lines changed

4 files changed

+0
-34
lines changed

tests/test_api_gateway/test_rest/test_admin.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from aiohttp.test_utils import (
99
AioHTTPTestCase,
10-
unittest_run_loop,
1110
)
1211

1312
from minos.api_gateway.rest import (
@@ -43,7 +42,6 @@ async def get_application(self):
4342

4443
return await rest_service.create_application()
4544

46-
@unittest_run_loop
4745
async def test_admin_login(self):
4846
url = "/admin/login"
4947

@@ -57,7 +55,6 @@ async def test_admin_login(self):
5755
self.assertIn("id", await response.text())
5856
self.assertIn("token", await response.text())
5957

60-
@unittest_run_loop
6158
async def test_admin_login_no_data(self):
6259
url = "/admin/login"
6360

@@ -66,7 +63,6 @@ async def test_admin_login_no_data(self):
6663
self.assertEqual(401, response.status)
6764
self.assertDictEqual({"error": "Something went wrong!."}, json.loads(await response.text()))
6865

69-
@unittest_run_loop
7066
async def test_admin_login_wrong_data(self):
7167
url = "/admin/login"
7268

@@ -105,7 +101,6 @@ async def get_application(self):
105101

106102
return await rest_service.create_application()
107103

108-
@unittest_run_loop
109104
async def test_admin_get_endpoints(self):
110105
url = "/admin/endpoints"
111106

@@ -137,7 +132,6 @@ async def get_application(self):
137132

138133
return await rest_service.create_application()
139134

140-
@unittest_run_loop
141135
async def test_admin_get_endpoints(self):
142136
url = "/admin/endpoints"
143137

@@ -168,15 +162,13 @@ async def get_application(self):
168162

169163
return await rest_service.create_application()
170164

171-
@unittest_run_loop
172165
async def test_admin_get_rules(self):
173166
url = "/admin/rules"
174167

175168
response = await self.client.request("GET", url)
176169

177170
self.assertEqual(200, response.status)
178171

179-
@unittest_run_loop
180172
async def test_admin_create_rule(self):
181173
url = "/admin/rules"
182174

@@ -188,7 +180,6 @@ async def test_admin_create_rule(self):
188180

189181
self.assertEqual(200, response.status)
190182

191-
@unittest_run_loop
192183
async def test_admin_update_rule(self):
193184
url = "/admin/rules"
194185

@@ -212,7 +203,6 @@ async def test_admin_update_rule(self):
212203

213204
self.assertEqual(200, response.status)
214205

215-
@unittest_run_loop
216206
async def test_admin_delete_rule(self):
217207
url = "/admin/rules"
218208

tests/test_api_gateway/test_rest/test_authentication.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from aiohttp.test_utils import (
1212
AioHTTPTestCase,
13-
unittest_run_loop,
1413
)
1514
from werkzeug.exceptions import (
1615
abort,
@@ -88,7 +87,6 @@ async def get_application(self):
8887

8988
return await rest_service.create_application()
9089

91-
@unittest_run_loop
9290
async def test_auth_headers_1(self):
9391
url = "/order"
9492
headers = {"Authorization": "Bearer credential-token-test"}
@@ -98,7 +96,6 @@ async def test_auth_headers_1(self):
9896
self.assertEqual(200, response.status)
9997
self.assertIn("Microservice call correct!!!", await response.text())
10098

101-
@unittest_run_loop
10299
async def test_auth_headers_2(self):
103100
url = "/merchants/5"
104101
headers = {"Authorization": "Bearer credential-token-test"}
@@ -108,7 +105,6 @@ async def test_auth_headers_2(self):
108105
self.assertEqual(200, response.status)
109106
self.assertIn("Microservice call correct!!!", await response.text())
110107

111-
@unittest_run_loop
112108
async def test_auth_headers_3(self):
113109
url = "/categories/5"
114110
headers = {"Authorization": "Bearer credential-token-test"}
@@ -118,7 +114,6 @@ async def test_auth_headers_3(self):
118114
self.assertEqual(200, response.status)
119115
self.assertIn("Microservice call correct!!!", await response.text())
120116

121-
@unittest_run_loop
122117
async def test_default_auth_headers(self):
123118
url = "/auth/token"
124119
headers = {"Authorization": "Bearer credential-token-test"}
@@ -128,7 +123,6 @@ async def test_default_auth_headers(self):
128123
self.assertEqual(200, response.status)
129124
self.assertIn("token", await response.text())
130125

131-
@unittest_run_loop
132126
async def test_auth(self):
133127
url = "/auth/credentials"
134128
headers = {"Authorization": "Bearer credential-token-test"}
@@ -138,7 +132,6 @@ async def test_auth(self):
138132
self.assertEqual(200, response.status)
139133
self.assertIn("uuid", await response.text())
140134

141-
@unittest_run_loop
142135
async def test_wrong_auth_headers(self):
143136
url = "/order"
144137
headers = {"Authorization": "Bearer"} # Missing token
@@ -147,7 +140,6 @@ async def test_wrong_auth_headers(self):
147140
self.assertEqual(200, response.status)
148141
self.assertIn("Microservice call correct!!!", await response.text())
149142

150-
@unittest_run_loop
151143
async def test_request_has_token(self):
152144
url = "/order"
153145
headers = {"Authorization": "Bearer"} # Missing token
@@ -193,7 +185,6 @@ async def get_application(self):
193185

194186
return await rest_service.create_application()
195187

196-
@unittest_run_loop
197188
async def test_auth_disabled(self):
198189
url = "/order"
199190
headers = {"Authorization": "Bearer test_token"}
@@ -245,7 +236,6 @@ async def get_application(self):
245236

246237
return await rest_service.create_application()
247238

248-
@unittest_run_loop
249239
async def test_auth_unauthorized(self):
250240
await self.client.post(
251241
"/admin/rules",
@@ -296,7 +286,6 @@ async def get_application(self):
296286

297287
return await rest_service.create_application()
298288

299-
@unittest_run_loop
300289
async def test_auth_unreachable(self):
301290
url = "/merchants/iweuwieuwe"
302291
headers = {"Authorization": "Bearer test_token"}
@@ -305,7 +294,6 @@ async def test_auth_unreachable(self):
305294
self.assertEqual(503, response.status)
306295
self.assertEqual("The requested endpoint is not available.", await response.text())
307296

308-
@unittest_run_loop
309297
async def test_auth(self):
310298
url = "/auth/credentials"
311299
headers = {"Authorization": "Bearer credential-token-test"}

tests/test_api_gateway/test_rest/test_cors.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import attr
77
from aiohttp.test_utils import (
88
AioHTTPTestCase,
9-
unittest_run_loop,
109
)
1110
from aiohttp_middlewares.cors import (
1211
ACCESS_CONTROL_ALLOW_HEADERS,
@@ -77,7 +76,6 @@ def check_allow_origin(
7776
if allow_methods:
7877
assert response.headers[ACCESS_CONTROL_ALLOW_METHODS] == ", ".join(allow_methods)
7978

80-
@unittest_run_loop
8179
async def test_cors_enabled(self):
8280
method = "GET"
8381
extra_headers = {}

tests/test_api_gateway/test_rest/test_service.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from aiohttp.test_utils import (
77
AioHTTPTestCase,
8-
unittest_run_loop,
98
)
109
from werkzeug.exceptions import (
1110
abort,
@@ -60,39 +59,34 @@ async def get_application(self):
6059

6160
return await rest_service.create_application()
6261

63-
@unittest_run_loop
6462
async def test_get(self):
6563
url = "/order/5?verb=GET&path=12324"
6664
response = await self.client.request("GET", url)
6765

6866
self.assertEqual(200, response.status)
6967
self.assertIn("Microservice call correct!!!", await response.text())
7068

71-
@unittest_run_loop
7269
async def test_post(self):
7370
url = "/order"
7471
response = await self.client.request("POST", url)
7572

7673
self.assertEqual(200, response.status)
7774
self.assertIn("Microservice call correct!!!", await response.text())
7875

79-
@unittest_run_loop
8076
async def test_put(self):
8177
url = "/order/5"
8278
response = await self.client.request("PUT", url)
8379

8480
self.assertEqual(200, response.status)
8581
self.assertIn("Microservice call correct!!!", await response.text())
8682

87-
@unittest_run_loop
8883
async def test_patch(self):
8984
url = "/order/5"
9085
response = await self.client.request("PATCH", url)
9186

9287
self.assertEqual(200, response.status)
9388
self.assertIn("Microservice call correct!!!", await response.text())
9489

95-
@unittest_run_loop
9690
async def test_delete(self):
9791
url = "/order/5"
9892
response = await self.client.request("DELETE", url)
@@ -125,7 +119,6 @@ async def get_application(self):
125119

126120
return await rest_service.create_application()
127121

128-
@unittest_run_loop
129122
async def test_get(self):
130123
url = "/order/5?verb=GET&path=12324"
131124
response = await self.client.request("GET", url)
@@ -160,7 +153,6 @@ async def get_application(self):
160153

161154
return await rest_service.create_application()
162155

163-
@unittest_run_loop
164156
async def test_get(self):
165157
url = "/order/5?verb=GET&path=12324"
166158
response = await self.client.request("GET", url)
@@ -187,7 +179,6 @@ async def get_application(self):
187179

188180
return await rest_service.create_application()
189181

190-
@unittest_run_loop
191182
async def test_get(self):
192183
url = "/order/5?verb=GET&path=12324"
193184
response = await self.client.request("GET", url)
@@ -224,7 +215,6 @@ async def get_application(self):
224215

225216
return await rest_service.create_application()
226217

227-
@unittest_run_loop
228218
async def test_get(self):
229219
url = "/order/5?verb=GET&path=12324"
230220
response = await self.client.request("GET", url)

0 commit comments

Comments
 (0)