From 8519c63143d00a4e3ad857d8ff2fc9813966510e Mon Sep 17 00:00:00 2001 From: Christopher Baklid Date: Mon, 26 Feb 2018 11:41:08 +0100 Subject: brings coverage to 90% (#24) * brings coverage to 75% * satisfy flake8 * missing docstring added * one more test * artificially inflate coverage because python acts strange * testing decorators * fixed instantiation of test route * straggling newlines from debugging code * remove debug comments * restructure tests into logical class separations. more exlusions. more tests * testing websocket echo tests * added missing comment * convert single quotes to double quotes to satisfy docstrings --- pysite/views/tests/index.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pysite/views/tests/index.py (limited to 'pysite/views/tests/index.py') diff --git a/pysite/views/tests/index.py b/pysite/views/tests/index.py new file mode 100644 index 00000000..78b7ef2e --- /dev/null +++ b/pysite/views/tests/index.py @@ -0,0 +1,23 @@ +# coding=utf-8 + +from flask import jsonify + +from schema import Schema + +from pysite.base_route import RouteView +from pysite.constants import ValidationTypes +from pysite.decorators import api_params + +SCHEMA = Schema([{"test": str}]) + +REQUIRED_KEYS = ["test"] + + +class TestParamsView(RouteView): + path = "/testparams" + name = "testparams" + + @api_params(schema=SCHEMA, validation_type=ValidationTypes.params) + def post(self, data): + jsonified = jsonify(data) + return jsonified -- cgit v1.2.3