From 0b01048aadc21dbd199d04192eede3949faad340 Mon Sep 17 00:00:00 2001 From: theakhiljha Date: Wed, 31 Mar 2021 02:31:17 +0530 Subject: [PATCH] Revert "Checking to generate coverage report" This reverts commit 7c4f9e6ee672ed260e15e8c156a785e1eec3a60b. --- .vscode/settings.json | 3 --- app/Meta.py | 6 +++--- yaba_test/test_yaba.py | 14 +++++++------- 3 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index f2d90cb..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.linting.enabled": true -} \ No newline at end of file diff --git a/app/Meta.py b/app/Meta.py index aa82bb1..fb5c1ff 100644 --- a/app/Meta.py +++ b/app/Meta.py @@ -7,7 +7,7 @@ import traceback import logging import pandas as pd -from flask import make_response, jsonify +from flask import make_response,jsonify from db import * from werkzeug import secure_filename,FileStorage from sqlalchemy.exc import IntegrityError @@ -27,12 +27,12 @@ def save_tempFile(File): # Sanitise the filename a_file_name = secure_filename(File.filename) - UPLOAD_PATH = os.path.join(os.getcwd(), UPLOAD_FOLDER,a_file_name) + UPLOAD_PATH=os.path.join(os.getcwd(),UPLOAD_FOLDER,a_file_name) # Save file File.save(UPLOAD_PATH) return None -def insert_experiments(username, fileName, status=True): +def insert_experiments(username,fileName,status=True): """ This function responds to a request for /yaba/v1/experiments with csv file. It first checks the file is appropriate one and then add new column user_id to dataframe. diff --git a/yaba_test/test_yaba.py b/yaba_test/test_yaba.py index 7fe9735..e8a1773 100644 --- a/yaba_test/test_yaba.py +++ b/yaba_test/test_yaba.py @@ -27,14 +27,14 @@ def test_insert_sites(self): prj_file = 'input_files/S8_two_row_polys.prj' shx_file = 'input_files/S8_two_row_polys.shx' - files = {'fileName': open(csv_path, 'rb'), + files= {'fileName': open(csv_path, 'rb'), 'shp_file': open(shp_file, 'rb'), 'dbf_file':open(dbf_file, 'rb'), 'prj_file': open(prj_file, 'rb'), 'shx_file': open(shx_file, 'rb')} response = requests.post('http://0.0.0.0:5001/yaba/v1/sites', - files=files) + files=files) self.assertEqual(response.status_code, 201) self.assertTrue(response.ok) @@ -52,7 +52,7 @@ def test_insert_cultivars(self): csv = 'input_files/'+csv_filename files = {'fileName': open(csv, 'rb')} response = requests.post( - 'http://0.0.0.0:5001/yaba/v1/cultivars?username=guestuser', files=files) + 'http://0.0.0.0:5001/yaba/v1/cultivars', files=files) self.assertEqual(response.status_code, 201) self.assertTrue(response.ok) @@ -70,7 +70,7 @@ def test_insert_experimentSites(self): csv = 'input_files/'+csv_filename files = {'fileName': open(csv, 'rb')} response = requests.post( - 'http://0.0.0.0:5001/yaba/v1/experiments_sites?username=guestuser', files=files) + 'http://0.0.0.0:5001/yaba/v1/experiments_sites', files=files) self.assertEqual(response.status_code, 201) self.assertTrue(response.ok) @@ -79,7 +79,7 @@ def test_insert_experimentTreatments(self): csv = 'input_files/'+csv_filename files = {'fileName': open(csv, 'rb')} response = requests.post( - 'http://0.0.0.0:5001/yaba/v1/experiments_treatments?username=guestuser', files=files) + 'http://0.0.0.0:5001/yaba/v1/experiments_treatments', files=files) self.assertEqual(response.status_code, 201) self.assertTrue(response.ok) @@ -88,7 +88,7 @@ def test_insert_sitesCultivars(self): csv = 'input_files/'+csv_filename files = {'fileName': open(csv, 'rb')} response = requests.post( - 'http://0.0.0.0:5001/yaba/v1/sites_cultivars?username=guestuser', files=files) + 'http://0.0.0.0:5001/yaba/v1/sites_cultivars', files=files) self.assertEqual(response.status_code, 201) self.assertTrue(response.ok) @@ -97,7 +97,7 @@ def test_insert_citationsSites(self): csv = 'input_files/'+csv_filename files = {'fileName': open(csv, 'rb')} response = requests.post( - 'http://0.0.0.0:5001/yaba/v1/citations_sites?username=guestuser', files=files) + 'http://0.0.0.0:5001/yaba/v1/citations_sites', files=files) self.assertEqual(response.status_code, 201) self.assertTrue(response.ok)