diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index 692e6992..3a2f9b6a 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -291,6 +291,10 @@ class InternalStatsView(DeviceView): output.headers['Content-type'] = 'text/csv' return output +class WbConfDocumentView(DeviceView): + def get(self, wbtype: str): + return jsonify('') + class DocumentDef(Resource): __type__ = 'Document' @@ -358,3 +362,9 @@ class DocumentDef(Resource): auth=app.auth) actions_view = app.auth.requires_auth(actions_view) self.add_url_rule('/actions/', defaults=d, view_func=actions_view, methods=get) + + wbconf_view = ActionsDocumentView.as_view('WbConfDocumentView', + definition=self, + auth=app.auth) + wbconf_view = app.auth.requires_auth(wbconf_view) + self.add_url_rule('/wbconf/', defaults=d, view_func=wbconf_view, methods=get) diff --git a/tests/test_documents.py b/tests/test_documents.py index 5ac747b5..9639688a 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -465,7 +465,7 @@ def test_get_document_lots(user: UserClient, user2: UserClient): @pytest.mark.mvp def test_get_document_internal_stats(user: UserClient, user2: UserClient): - """Tests for get teh internal stats.""" + """Tests for get the internal stats.""" # csv_str, _ = user.get(res=documents.DocumentDef.t, # item='internalstats/') @@ -490,3 +490,10 @@ def test_get_document_internal_stats(user: UserClient, user2: UserClient): export_csv = list(obj_csv) assert csv_str.strip() == '""' + +@pytest.mark.mvp +def test_get_wbconf(user: UserClient): + """Tests for get env file for usb wb.""" + + csv_str, _ = user.get(res=documents.DocumentDef.t, + item='wbconf/')