fixing basic tests

This commit is contained in:
Cayo Puigdefabregas 2021-02-11 21:04:18 +01:00
parent 91848a548c
commit aa5fb1d9fd

View file

@ -27,87 +27,88 @@ def test_dependencies():
def test_api_docs(client: Client): def test_api_docs(client: Client):
"""Tests /apidocs correct initialization.""" """Tests /apidocs correct initialization."""
docs, _ = client.get('/apidocs') docs, _ = client.get('/apidocs')
# import pdb; pdb.set_trace()
assert set(docs['paths'].keys()) == { assert set(docs['paths'].keys()) == {
'/actions/', '/actions/',
'/apidocs', '/apidocs',
'/batteries/{dev1_id}/merge/{dev2_id}', '/allocates/',
'/bikes/{dev1_id}/merge/{dev2_id}', '/deallocates/',
'/cameras/{dev1_id}/merge/{dev2_id}',
'/cellphones/{dev1_id}/merge/{dev2_id}',
'/components/{dev1_id}/merge/{dev2_id}',
'/computer-accessories/{dev1_id}/merge/{dev2_id}',
'/computer-monitors/{dev1_id}/merge/{dev2_id}',
'/computers/{dev1_id}/merge/{dev2_id}',
'/cookings/{dev1_id}/merge/{dev2_id}',
'/data-storages/{dev1_id}/merge/{dev2_id}',
'/dehumidifiers/{dev1_id}/merge/{dev2_id}',
'/deliverynotes/', '/deliverynotes/',
'/desktops/{dev1_id}/merge/{dev2_id}',
'/devices/', '/devices/',
'/devices/static/{filename}', '/devices/static/{filename}',
'/devices/{dev1_id}/merge/{dev2_id}', '/documents/static/{filename}',
'/displays/{dev1_id}/merge/{dev2_id}',
'/diy-and-gardenings/{dev1_id}/merge/{dev2_id}',
'/documents/devices/',
'/documents/actions/', '/documents/actions/',
'/documents/erasures/', '/documents/erasures/',
'/documents/lots/', '/documents/devices/',
'/documents/static/{filename}', '/documents/stamps/',
'/documents/stock/', '/documents/stock/',
'/documents/check/', '/documents/check/',
'/documents/stamps/', '/documents/lots/',
'/drills/{dev1_id}/merge/{dev2_id}', '/versions/',
'/graphic-cards/{dev1_id}/merge/{dev2_id}', '/manufacturers/',
'/hard-drives/{dev1_id}/merge/{dev2_id}', '/licences/',
'/homes/{dev1_id}/merge/{dev2_id}', '/lives/',
'/hubs/{dev1_id}/merge/{dev2_id}',
'/keyboards/{dev1_id}/merge/{dev2_id}',
'/label-printers/{dev1_id}/merge/{dev2_id}',
'/laptops/{dev1_id}/merge/{dev2_id}',
'/lots/', '/lots/',
'/lots/{id}/children', '/lots/{id}/children',
'/lots/{id}/devices', '/lots/{id}/devices',
'/manufacturers/', '/metrics/',
'/memory-card-readers/{dev1_id}/merge/{dev2_id}',
'/mice/{dev1_id}/merge/{dev2_id}',
'/microphones/{dev1_id}/merge/{dev2_id}',
'/mixers/{dev1_id}/merge/{dev2_id}',
'/mobiles/{dev1_id}/merge/{dev2_id}',
'/monitors/{dev1_id}/merge/{dev2_id}',
'/motherboards/{dev1_id}/merge/{dev2_id}',
'/network-adapters/{dev1_id}/merge/{dev2_id}',
'/networkings/{dev1_id}/merge/{dev2_id}',
'/pack-of-screwdrivers/{dev1_id}/merge/{dev2_id}',
'/printers/{dev1_id}/merge/{dev2_id}',
'/processors/{dev1_id}/merge/{dev2_id}',
'/rackets/{dev1_id}/merge/{dev2_id}',
'/ram-modules/{dev1_id}/merge/{dev2_id}',
'/recreations/{dev1_id}/merge/{dev2_id}',
'/routers/{dev1_id}/merge/{dev2_id}',
'/sais/{dev1_id}/merge/{dev2_id}',
'/servers/{dev1_id}/merge/{dev2_id}',
'/smartphones/{dev1_id}/merge/{dev2_id}',
'/solid-state-drives/{dev1_id}/merge/{dev2_id}',
'/sound-cards/{dev1_id}/merge/{dev2_id}',
'/sounds/{dev1_id}/merge/{dev2_id}',
'/stairs/{dev1_id}/merge/{dev2_id}',
'/switches/{dev1_id}/merge/{dev2_id}',
'/tablets/{dev1_id}/merge/{dev2_id}',
'/tags/', '/tags/',
'/tags/{tag_id}/device/{device_id}', '/tags/{tag_id}/device/{device_id}',
'/television-sets/{dev1_id}/merge/{dev2_id}',
'/users/', '/users/',
'/users/login/', '/users/login/'
'/video-scalers/{dev1_id}/merge/{dev2_id}', # '/devices/{dev1_id}/merge/{dev2_id}',
'/videoconferences/{dev1_id}/merge/{dev2_id}', # '/batteries/{dev1_id}/merge/{dev2_id}',
'/videos/{dev1_id}/merge/{dev2_id}', # '/bikes/{dev1_id}/merge/{dev2_id}',
'/wireless-access-points/{dev1_id}/merge/{dev2_id}', # '/cameras/{dev1_id}/merge/{dev2_id}',
'/versions/', # '/cellphones/{dev1_id}/merge/{dev2_id}',
'/allocates/', # '/components/{dev1_id}/merge/{dev2_id}',
'/deallocates/', # '/computer-accessories/{dev1_id}/merge/{dev2_id}',
'/metrics/', # '/computer-monitors/{dev1_id}/merge/{dev2_id}',
'/licences/', # '/computers/{dev1_id}/merge/{dev2_id}',
'/lives/', # '/cookings/{dev1_id}/merge/{dev2_id}',
# '/data-storages/{dev1_id}/merge/{dev2_id}',
# '/dehumidifiers/{dev1_id}/merge/{dev2_id}',
# '/desktops/{dev1_id}/merge/{dev2_id}',
# '/displays/{dev1_id}/merge/{dev2_id}',
# '/diy-and-gardenings/{dev1_id}/merge/{dev2_id}',
# '/drills/{dev1_id}/merge/{dev2_id}',
# '/graphic-cards/{dev1_id}/merge/{dev2_id}',
# '/hard-drives/{dev1_id}/merge/{dev2_id}',
# '/homes/{dev1_id}/merge/{dev2_id}',
# '/hubs/{dev1_id}/merge/{dev2_id}',
# '/keyboards/{dev1_id}/merge/{dev2_id}',
# '/label-printers/{dev1_id}/merge/{dev2_id}',
# '/laptops/{dev1_id}/merge/{dev2_id}',
# '/memory-card-readers/{dev1_id}/merge/{dev2_id}',
# '/mice/{dev1_id}/merge/{dev2_id}',
# '/microphones/{dev1_id}/merge/{dev2_id}',
# '/mixers/{dev1_id}/merge/{dev2_id}',
# '/mobiles/{dev1_id}/merge/{dev2_id}',
# '/monitors/{dev1_id}/merge/{dev2_id}',
# '/motherboards/{dev1_id}/merge/{dev2_id}',
# '/network-adapters/{dev1_id}/merge/{dev2_id}',
# '/networkings/{dev1_id}/merge/{dev2_id}',
# '/pack-of-screwdrivers/{dev1_id}/merge/{dev2_id}',
# '/printers/{dev1_id}/merge/{dev2_id}',
# '/processors/{dev1_id}/merge/{dev2_id}',
# '/rackets/{dev1_id}/merge/{dev2_id}',
# '/ram-modules/{dev1_id}/merge/{dev2_id}',
# '/recreations/{dev1_id}/merge/{dev2_id}',
# '/routers/{dev1_id}/merge/{dev2_id}',
# '/sais/{dev1_id}/merge/{dev2_id}',
# '/servers/{dev1_id}/merge/{dev2_id}',
# '/smartphones/{dev1_id}/merge/{dev2_id}',
# '/solid-state-drives/{dev1_id}/merge/{dev2_id}',
# '/sound-cards/{dev1_id}/merge/{dev2_id}',
# '/sounds/{dev1_id}/merge/{dev2_id}',
# '/stairs/{dev1_id}/merge/{dev2_id}',
# '/switches/{dev1_id}/merge/{dev2_id}',
# '/tablets/{dev1_id}/merge/{dev2_id}',
# '/television-sets/{dev1_id}/merge/{dev2_id}',
# '/video-scalers/{dev1_id}/merge/{dev2_id}',
# '/videoconferences/{dev1_id}/merge/{dev2_id}',
# '/videos/{dev1_id}/merge/{dev2_id}',
# '/wireless-access-points/{dev1_id}/merge/{dev2_id}',
} }
assert docs['info'] == {'title': 'Devicehub', 'version': '0.2'} assert docs['info'] == {'title': 'Devicehub', 'version': '0.2'}
assert docs['components']['securitySchemes']['bearerAuth'] == { assert docs['components']['securitySchemes']['bearerAuth'] == {