Skip to content

Commit

Permalink
Remove code artefact and stabilize the client tests (#277)
Browse files Browse the repository at this point in the history
* Remove code artefact from PR #273

* Make client tests more robust

* Add body to status code assertion for better reporting

* Use repr instead of str in unexpected error details

* Add file_exists error status

* Add bad_timestamp_configuration error
  • Loading branch information
vxgmichel authored Sep 26, 2023
1 parent 002c73b commit e9fc008
Show file tree
Hide file tree
Showing 6 changed files with 303 additions and 262 deletions.
5 changes: 5 additions & 0 deletions client/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Voici la liste des erreurs par ordre alphabétique:
- `bad_data` (HTTP 400)
- `bad_greeter_sas` (HTTP 400)
- `bad_key` (HTTP 400)
- `bad_timestamp_configuration` (HTTP 400)
- `cannot_delete_root_folder` (HTTP 400)
- `cannot_move_root_folder` (HTTP 400)
- `cannot_use_both_authentication_modes` (HTTP 400)
Expand All @@ -35,6 +36,7 @@ Voici la liste des erreurs par ordre alphabétique:
- `email_not_in_recipients` (HTTP 400)
- `failed_to_disable_offline_availability` (HTTP 400)
- `failed_to_enable_offline_availability` (HTTP 400)
- `file_exists` (HTTP 400)
- `forbidden_workspace` (HTTP 403)
- `invalid_configuration` (HTTP 400)
- `invalid_passphrase` (HTTP 400)
Expand Down Expand Up @@ -1077,6 +1079,7 @@ HTTP 200
- HTTP 404: `unknown_workspace`
- HTTP 410: `deleted_workspace`
- HTTP 403: `forbidden_workspace`
- HTTP 400: `bad_timestamp_configuration`
- HTTP 401: `not_connected_to_rie`


Expand Down Expand Up @@ -1339,6 +1342,7 @@ HTTP 201
- HTTP 403: `forbidden_workspace`
- HTTP 403: `archived_workspace`
- HTTP 404: `unknown_parent`
- HTTP 400: `file_exists`
- HTTP 503: `offline`, le client Parsec n'a pas pu joindre le serveur Parsec (e.g. le poste client est hors-ligne et le chemin à accéder n'est pas dans le cache local)

### `POST /workspaces/<id>/folders/rename`
Expand Down Expand Up @@ -1501,6 +1505,7 @@ HTTP 201
- HTTP 410: `deleted_workspace`
- HTTP 403: `forbidden_workspace`
- HTTP 404: `unknown_path`
- HTTP 400: `file_exists`
- HTTP 503: `offline`, le client Parsec n'a pas pu joindre le serveur Parsec (e.g. le poste client est hors-ligne et le chemin à accéder n'est pas dans le cache local)


Expand Down
2 changes: 1 addition & 1 deletion client/client_tests/test_api_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ async def test_bad_workspace(testbed: FilesTestBed, bad_wid: str):
async def test_create_folder_already_exists(testbed: FilesTestBed):
await testbed.create_folder("foo", parent=testbed.root_entry_id)

expected_body = {"error": "unexpected_error", "detail": "File exists: /foo"}
expected_body = {"error": "file_exists"}
assert (
await testbed.create_folder("foo", parent=testbed.root_entry_id, expected_status_code=400)
== expected_body
Expand Down
Loading

0 comments on commit e9fc008

Please sign in to comment.