From 02040199bb19806d017602e2aac111ef80427fc9 Mon Sep 17 00:00:00 2001 From: nad Date: Wed, 15 Jul 2020 13:11:50 +0200 Subject: [PATCH] Fixing test_basic.py::test_api_docs and test_workbench.py::test_real_custom --- tests/test_basic.py | 78 ++++++++++++++++++++++++++++++++++------- tests/test_workbench.py | 4 +-- 2 files changed, 67 insertions(+), 15 deletions(-) diff --git a/tests/test_basic.py b/tests/test_basic.py index ca2f2e05..ce941d87 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -28,24 +28,76 @@ def test_api_docs(client: Client): """Tests /apidocs correct initialization.""" docs, _ = client.get('/apidocs') assert set(docs['paths'].keys()) == { - # todo this does not appear: '/tags/{id}/device', - '/apidocs', - '/users/', - '/devices/', - '/tags/', - '/users/login/', '/actions/', + '/apidocs', + '/batteries/{id}/merge/', + '/bikes/{id}/merge/', + '/cameras/{id}/merge/', + '/cellphones/{id}/merge/', + '/components/{id}/merge/', + '/computer-accessories/{id}/merge/', + '/computer-monitors/{id}/merge/', + '/computers/{id}/merge/', + '/cookings/{id}/merge/', + '/data-storages/{id}/merge/', + '/dehumidifiers/{id}/merge/', + '/deliverynotes/', + '/desktops/{id}/merge/', + '/devices/', + '/devices/static/{filename}', + '/devices/{id}/merge/', + '/displays/{id}/merge/', + '/diy-and-gardenings/{id}/merge/', + '/documents/devices/', + '/documents/erasures/', + '/documents/static/{filename}', + '/drills/{id}/merge/', + '/graphic-cards/{id}/merge/', + '/hard-drives/{id}/merge/', + '/homes/{id}/merge/', + '/hubs/{id}/merge/', + '/keyboards/{id}/merge/', + '/label-printers/{id}/merge/', + '/laptops/{id}/merge/', '/lots/', - '/manufacturers/', '/lots/{id}/children', '/lots/{id}/devices', - '/documents/erasures/', - '/documents/devices/', - '/documents/static/{filename}', + '/manufacturers/', + '/memory-card-readers/{id}/merge/', + '/mice/{id}/merge/', + '/microphones/{id}/merge/', + '/mixers/{id}/merge/', + '/mobiles/{id}/merge/', + '/monitors/{id}/merge/', + '/motherboards/{id}/merge/', + '/network-adapters/{id}/merge/', + '/networkings/{id}/merge/', + '/pack-of-screwdrivers/{id}/merge/', + '/printers/{id}/merge/', + '/processors/{id}/merge/', + '/proofs/', + '/rackets/{id}/merge/', + '/ram-modules/{id}/merge/', + '/recreations/{id}/merge/', + '/routers/{id}/merge/', + '/sais/{id}/merge/', + '/servers/{id}/merge/', + '/smartphones/{id}/merge/', + '/solid-state-drives/{id}/merge/', + '/sound-cards/{id}/merge/', + '/sounds/{id}/merge/', + '/stairs/{id}/merge/', + '/switches/{id}/merge/', + '/tablets/{id}/merge/', + '/tags/', '/tags/{tag_id}/device/{device_id}', - '/devices/static/{filename}', - '/deliverynotes/', - '/proofs/' + '/television-sets/{id}/merge/', + '/users/', + '/users/login/', + '/video-scalers/{id}/merge/', + '/videoconferences/{id}/merge/', + '/videos/{id}/merge/', + '/wireless-access-points/{id}/merge/' } assert docs['info'] == {'title': 'Devicehub', 'version': '0.2'} assert docs['components']['securitySchemes']['bearerAuth'] == { diff --git a/tests/test_workbench.py b/tests/test_workbench.py index 82992048..1bc3d1ba 100644 --- a/tests/test_workbench.py +++ b/tests/test_workbench.py @@ -66,7 +66,6 @@ def test_workbench_server_condensed(user: UserClient): assert device['tags'][0]['id'] == 'tag1' -@pytest.mark.mvp @pytest.mark.xfail(reason='Functionality not yet developed.') def test_workbench_server_phases(user: UserClient): """Tests the phases described in the docs section `Snapshots from @@ -274,7 +273,7 @@ def test_snapshot_real_eee_1001pxd_with_rate(user: UserClient): @pytest.mark.mvp def test_real_custom(user: UserClient): s = file('real-custom.snapshot.11') - snapshot, _ = user.post(res=em.Snapshot, data=s, status=NeedsId) + snapshot, _ = user.post(res=em.Snapshot, data=s, status=201) # todo insert with tag @@ -303,6 +302,7 @@ SNAPSHOTS_NEED_ID = { @pytest.mark.xfail(reason='It needs to be fixed.') +@pytest.mark.mvp @pytest.mark.parametrize('file', (pytest.param(f, id=f.name) for f in pathlib.Path(__file__).parent.joinpath('workbench_files').iterdir())