Skip to content
Snippets Groups Projects
Commit 52d74c50 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

remove unused files

parent 7daf5ba2
No related branches found
Tags 0.24
No related merge requests found
from flask import Blueprint, jsonify, current_app
from brian_dashboard_manager.routes import common
from brian_dashboard_manager import CONFIG_KEY
routes = Blueprint("api-test", __name__)
@routes.after_request
def after_request(resp):
return common.after_request(resp)
@routes.route("/test1", methods=['GET', 'POST'])
@common.require_accepts_json
def test1():
return jsonify({
'config': current_app.config[CONFIG_KEY],
'success': True
})
import json
import jsonschema
DEFAULT_REQUEST_HEADERS = {
'Content-type': 'application/json',
'Accept': ['application/json']
}
def test_version_request(client):
version_schema = {
'$schema': 'http://json-schema.org/draft-07/schema#',
'type': 'object',
'properties': {
'api': {
'type': 'string',
'pattern': r'\d+\.\d+'
},
'module': {
'type': 'string',
'pattern': r'\d+\.\d+'
}
},
'required': ['api', 'module'],
'additionalProperties': False
}
rv = client.post(
'version',
headers=DEFAULT_REQUEST_HEADERS)
assert rv.status_code == 200
jsonschema.validate(
json.loads(rv.data.decode('utf-8')),
version_schema)
def test_test_proc1(client):
rv = client.post(
'test/test1',
headers=DEFAULT_REQUEST_HEADERS)
assert rv.status_code == 200
result = json.loads(rv.data.decode('utf-8'))
assert result # boilerplate test ...
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment