Skip to content

Commit 5eea6ae

Browse files
committed
Bump httpx and respx
1 parent 944ee65 commit 5eea6ae

File tree

8 files changed

+65
-69
lines changed

8 files changed

+65
-69
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ docs/_build
1010
.tox
1111
venv/
1212
tags
13+
.venv/

gitlab/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
import time
2222
from typing import Union
2323

24-
import httpx
25-
2624
import gitlab
2725
import gitlab.config
26+
import httpx
2827
from gitlab import exceptions as exc
2928
from gitlab import utils
3029
from gitlab.exceptions import GitlabHttpError, GitlabParsingError, on_http_error
@@ -159,7 +158,7 @@ def _get_client(self) -> httpx.AsyncClient:
159158

160159
auth = None
161160
if self.http_username:
162-
auth = httpx.auth.BasicAuth(self.http_username, self.http_password)
161+
auth = httpx.BasicAuth(self.http_username, self.http_password)
163162

164163
return self._httpx_client_class(
165164
auth=auth, verify=self.ssl_verify, timeout=self.timeout,

gitlab/tests/objects/test_application.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import pytest
44
import respx
5-
from httpx.status_codes import StatusCode
6-
75
from gitlab import AsyncGitlab
6+
from httpx import codes
87

98

109
class TestApplicationAppearance:
@@ -31,7 +30,7 @@ async def test_get_update_appearance(self, gl, gl_get_value, is_gl_sync):
3130
"message_font_color": "#ffffff",
3231
"email_header_and_footer_enabled": False,
3332
},
34-
status_code=StatusCode.OK,
33+
status_code=codes.OK,
3534
)
3635
request_update_appearance = respx.put(
3736
"http://localhost/api/v4/application/appearance",
@@ -48,7 +47,7 @@ async def test_get_update_appearance(self, gl, gl_get_value, is_gl_sync):
4847
"message_font_color": "#ffffff",
4948
"email_header_and_footer_enabled": False,
5049
},
51-
status_code=StatusCode.OK,
50+
status_code=codes.OK,
5251
)
5352

5453
appearance = gl.appearance.get()
@@ -86,7 +85,7 @@ async def test_update_appearance(self, gl, is_gl_sync):
8685
"message_font_color": "#ffffff",
8786
"email_header_and_footer_enabled": False,
8887
},
89-
status_code=StatusCode.OK,
88+
status_code=codes.OK,
9089
)
9190

9291
if is_gl_sync:

gitlab/tests/objects/test_projects.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import pytest
22
import respx
3-
from httpx.status_codes import StatusCode
4-
53
from gitlab import AsyncGitlab
4+
from httpx import codes
65

76

87
class TestProjectSnippets:
@@ -22,7 +21,7 @@ async def test_list_project_snippets(self, gl, gl_get_value):
2221
"visibility": visibility,
2322
}
2423
],
25-
status_code=StatusCode.OK,
24+
status_code=codes.OK,
2625
)
2726

2827
project = gl.projects.get(1, lazy=True)
@@ -47,7 +46,7 @@ async def test_get_project_snippet(self, gl, gl_get_value):
4746
"content": "source code with multiple lines",
4847
"visibility": visibility,
4948
},
50-
status_code=StatusCode.OK,
49+
status_code=codes.OK,
5150
)
5251

5352
project = gl.projects.get(1, lazy=True)
@@ -71,7 +70,7 @@ async def test_create_update_project_snippets(self, gl, gl_get_value, is_gl_sync
7170
"content": "source code with multiple lines",
7271
"visibility": visibility,
7372
},
74-
status_code=StatusCode.OK,
73+
status_code=codes.OK,
7574
)
7675

7776
request_create = respx.post(
@@ -83,7 +82,7 @@ async def test_create_update_project_snippets(self, gl, gl_get_value, is_gl_sync
8382
"content": "source code with multiple lines",
8483
"visibility": visibility,
8584
},
86-
status_code=StatusCode.OK,
85+
status_code=codes.OK,
8786
)
8887

8988
project = gl.projects.get(1, lazy=True)

gitlab/tests/test_async_mixins.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import pytest
22
import respx
3-
from httpx.status_codes import StatusCode
4-
53
from gitlab import AsyncGitlab
64
from gitlab.base import RESTObject, RESTObjectList
75
from gitlab.mixins import (
@@ -15,6 +13,7 @@
1513
SetMixin,
1614
UpdateMixin,
1715
)
16+
from httpx import codes
1817

1918
from .test_mixins import FakeManager, FakeObject
2019

@@ -36,7 +35,7 @@ class M(GetMixin, FakeManager):
3635
"http://localhost/api/v4/tests/42",
3736
headers={"Content-Type": "application/json"},
3837
content={"id": 42, "foo": "bar"},
39-
status_code=StatusCode.OK,
38+
status_code=codes.OK,
4039
)
4140
mgr = M(gl)
4241
obj = await mgr.get(42)
@@ -54,7 +53,7 @@ class O(RefreshMixin, FakeObject):
5453
"http://localhost/api/v4/tests/42",
5554
headers={"Content-Type": "application/json"},
5655
content={"id": 42, "foo": "bar"},
57-
status_code=StatusCode.OK,
56+
status_code=codes.OK,
5857
)
5958
mgr = FakeManager(gl)
6059
obj = O(mgr, {"id": 42})
@@ -73,7 +72,7 @@ class M(GetWithoutIdMixin, FakeManager):
7372
"http://localhost/api/v4/tests",
7473
headers={"Content-Type": "application/json"},
7574
content='{"foo": "bar"}',
76-
status_code=StatusCode.OK,
75+
status_code=codes.OK,
7776
)
7877

7978
mgr = M(gl)
@@ -92,7 +91,7 @@ class M(ListMixin, FakeManager):
9291
"http://localhost/api/v4/tests",
9392
headers={"Content-Type": "application/json"},
9493
content='[{"id": 42, "foo": "bar"},{"id": 43, "foo": "baz"}]',
95-
status_code=StatusCode.OK,
94+
status_code=codes.OK,
9695
)
9796

9897
mgr = M(gl)
@@ -119,7 +118,7 @@ class M(ListMixin, FakeManager):
119118
"http://localhost/api/v4/others",
120119
headers={"Content-Type": "application/json"},
121120
content='[{"id": 42, "foo": "bar"}]',
122-
status_code=StatusCode.OK,
121+
status_code=codes.OK,
123122
)
124123

125124
mgr = M(gl)
@@ -142,7 +141,7 @@ class M(CreateMixin, FakeManager):
142141
"http://localhost/api/v4/tests",
143142
headers={"Content-Type": "application/json"},
144143
content='{"id": 42, "foo": "bar"}',
145-
status_code=StatusCode.OK,
144+
status_code=codes.OK,
146145
)
147146

148147
mgr = M(gl)
@@ -162,7 +161,7 @@ class M(CreateMixin, FakeManager):
162161
"http://localhost/api/v4/others",
163162
headers={"Content-Type": "application/json"},
164163
content='{"id": 42, "foo": "bar"}',
165-
status_code=StatusCode.OK,
164+
status_code=codes.OK,
166165
)
167166

168167
mgr = M(gl)
@@ -182,7 +181,7 @@ class M(UpdateMixin, FakeManager):
182181
"http://localhost/api/v4/tests/42",
183182
headers={"Content-Type": "application/json"},
184183
content='{"id": 42, "foo": "baz"}',
185-
status_code=StatusCode.OK,
184+
status_code=codes.OK,
186185
)
187186

188187
mgr = M(gl)
@@ -202,7 +201,7 @@ class M(UpdateMixin, FakeManager):
202201
"http://localhost/api/v4/tests",
203202
headers={"Content-Type": "application/json"},
204203
content='{"foo": "baz"}',
205-
status_code=StatusCode.OK,
204+
status_code=codes.OK,
206205
)
207206
mgr = M(gl)
208207
server_data = await mgr.update(new_data={"foo": "baz"})
@@ -219,7 +218,7 @@ class M(DeleteMixin, FakeManager):
219218
"http://localhost/api/v4/tests/42",
220219
headers={"Content-Type": "application/json"},
221220
content="",
222-
status_code=StatusCode.OK,
221+
status_code=codes.OK,
223222
)
224223

225224
mgr = M(gl)
@@ -238,7 +237,7 @@ class O(SaveMixin, RESTObject):
238237
"http://localhost/api/v4/tests/42",
239238
headers={"Content-Type": "application/json"},
240239
content='{"id": 42, "foo": "baz"}',
241-
status_code=StatusCode.OK,
240+
status_code=codes.OK,
242241
)
243242

244243
mgr = M(gl)
@@ -258,7 +257,7 @@ class M(SetMixin, FakeManager):
258257
"http://localhost/api/v4/tests/foo",
259258
headers={"Content-Type": "application/json"},
260259
content='{"key": "foo", "value": "bar"}',
261-
status_code=StatusCode.OK,
260+
status_code=codes.OK,
262261
)
263262

264263
mgr = M(gl)

0 commit comments

Comments
 (0)