@@ -19,6 +19,7 @@ def fake_ui_url():
1919@fixture
2020def mocked_api (
2121 fake_api_url ,
22+ fake_user_json ,
2223 fake_info_json ,
2324 fake_block_info_json ,
2425 fake_samples_json ,
@@ -29,6 +30,9 @@ def mocked_api(
2930 fake_api = respx_mock .get ("/" , name = "api" )
3031 fake_api .return_value = Response (200 , content = "<!doctype html></html>" )
3132
33+ fake_authentication = respx_mock .get ("/get-current-user" , name = "current_user" )
34+ fake_authentication .return_value = Response (200 , json = fake_user_json )
35+
3236 fake_info_api = respx_mock .get ("/info" , name = "info" )
3337 fake_info_api .return_value = Response (200 , json = fake_info_json )
3438
@@ -247,6 +251,35 @@ def fake_block_info_json():
247251 )
248252
249253
254+ @fixture
255+ def fake_user_json ():
256+ """Returns a mocked JSON response from the /get-current-user endpoint."""
257+
258+ return json .loads (
259+ """
260+ {
261+ "account_status": "active",
262+ "contact_email": null,
263+ "display_name": "Jane Doe",
264+ "identities": [
265+ {
266+ "display_name": "Jane Doe",
267+ "identifier": "1111111",
268+ "identity_type": "github",
269+ "name": "jane-doe",
270+ "verified": true
271+ }
272+ ],
273+ "immutable_id": "6574f788aabb227db8d1b14e",
274+ "last_modified": null,
275+ "managers": null,
276+ "relationships": null,
277+ "role": "user",
278+ "type": "people"
279+ }"""
280+ )
281+
282+
250283@fixture (scope = "session" )
251284def fake_api_key ():
252285 """Returns a fake API key."""
0 commit comments