From 6087044a5ece84ecc4d050c52303dfc6f2997fae Mon Sep 17 00:00:00 2001 From: nad Date: Tue, 18 Aug 2020 19:19:18 +0200 Subject: [PATCH] Fixing test_get_multiple_lots and test_api_docs --- ereuse_devicehub/resources/documents/documents.py | 1 + tests/test_basic.py | 1 + tests/test_lot.py | 9 +++------ 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index ab188c6a..e9ba2cfc 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -129,6 +129,7 @@ class DevicesDocumentView(DeviceView): output.headers['Content-type'] = 'text/csv' return output + class LotsDocumentView(LotView): def find(self, args: dict): query = self.query(args) diff --git a/tests/test_basic.py b/tests/test_basic.py index eab9d4ef..dc0ce248 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -50,6 +50,7 @@ def test_api_docs(client: Client): '/diy-and-gardenings/{id}/merge/', '/documents/devices/', '/documents/erasures/', + '/documents/lots/', '/documents/static/{filename}', '/documents/stock/', '/drills/{id}/merge/', diff --git a/tests/test_lot.py b/tests/test_lot.py index a378736a..9c04b046 100644 --- a/tests/test_lot.py +++ b/tests/test_lot.py @@ -384,14 +384,11 @@ def test_lot_post_add_remove_device_view(app: Devicehub, user: UserClient): @pytest.mark.mvp -def test_get_all_lots(user: UserClient): - """Tests submitting and retreiving all lots.""" +def test_get_multiple_lots(user: UserClient): + """Tests submitting and retreiving multiple lots.""" l, _ = user.post({'name': 'Lot1', 'description': 'comments1,lot1,testcomment,'}, res=Lot) l, _ = user.post({'name': 'Lot2', 'description': 'comments2,lot2,testcomment,'}, res=Lot) l, _ = user.post({'name': 'Lot3', 'description': 'comments3,lot3,testcomment,'}, res=Lot) l, _ = user.get(res=Lot) - assert l['items'][0]['name'] == 'Lot1' - assert l['items'][0]['description'] == 'comments1,lot1,testcomment,' - assert l['items'][2]['name'] == 'Lot3' - assert l['items'][2]['description'] == 'comments3,lot3,testcomment,' + assert len(l) == 3