Skip to content

Commit

Permalink
Revert "Checking to generate coverage report"
Browse files Browse the repository at this point in the history
This reverts commit 7c4f9e6.
  • Loading branch information
cryolune committed Mar 30, 2021
1 parent 7c4f9e6 commit 0b01048
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

6 changes: 3 additions & 3 deletions app/Meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions yaba_test/test_yaba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down

0 comments on commit 0b01048

Please sign in to comment.