From f065ea860f8001942bbf7c61eb49e515d358d2eb Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Wed, 31 Mar 2021 22:31:01 +0300 Subject: add temp_db setup and integration tests --- gn3/api/datasets.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 gn3/api/datasets.py (limited to 'gn3/api') diff --git a/gn3/api/datasets.py b/gn3/api/datasets.py new file mode 100644 index 0000000..874c76a --- /dev/null +++ b/gn3/api/datasets.py @@ -0,0 +1,28 @@ +"""this module contains code for creating datasets""" +from flask import Blueprint +from flask import jsonify + +from gn3.computations.datasets import create_dataset + + +dataset = Blueprint("dataset", __name__) + + +@dataset.route("/") +def dataset_home(): + """initial test endpont for dataset""" + return jsonify({"results": "ok"}) + + +@dataset.route("/create//") +@dataset.route("/create//") +def create_dataset_api(dataset_name, dataset_type=None): + """Test api/create/dataset//""" + + new_dataset = create_dataset( + dataset_type=dataset_type, dataset_name=dataset_name) + + results = { + "dataset":new_dataset + } + return jsonify(results) -- cgit v1.2.3