Skip to content

Commit

Permalink
Added more unit tests and corrections based on unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
atanikan committed Jan 24, 2019
1 parent 3d86af6 commit c7badf9
Show file tree
Hide file tree
Showing 8 changed files with 191 additions and 90 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ matrix:
- os: osx
env: PYTHON=3.4.4
language: generic
- os: osx
language: generic
env: PYTHON=3.5.1

before_install: |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
Expand Down
15 changes: 8 additions & 7 deletions web/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
MONGODB_PASSWORD = os.environ.get("MONGODB_PASSWORD")
MONGODB_DB = os.environ.get("MONGODB_DB")


#app = Flask(__name__)
# Create the application instance
connexionapp = connexion.App(__name__, specification_dir='./')

# Read the swagger.yml file to configure the endpoints
connexionapp.add_api('swagger.yml')
app = connexionapp.app
app.secret_key = '\\\xfcS\x1e\x8f\xfb]6\x1e.\xa8\xb3\xe1x\xc8\x8e\xc1\xeb5^x\x81\xcc\xd5'

csrf = CSRFProtect(app)
SESSION_TYPE = 'filesystem'
app.config.from_object(__name__)
Expand All @@ -45,12 +44,14 @@
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
app.config['MAIL_ADDR'] = MAIL_ADDR
app.config['MAIL_PWD'] = MAIL_PWD
app.config['MONGODB_HOST'] = 'paperstack.uchicago.edu'
app.config['MONGODB_PORT'] = 27017
app.config['MONGODB_USERNAME'] = 'qresp_user_explorer'
app.config['MONGODB_PASSWORD'] = 'qresp_pwd'
app.config['MONGODB_DB'] = 'explorer'
app.config['MONGODB_HOST'] = MONGODB_HOST
app.config['MONGODB_PORT'] = MONGODB_PORT
app.config['MONGODB_USERNAME'] = MONGODB_USERNAME
app.config['MONGODB_PASSWORD'] = MONGODB_PASSWORD
app.config['MONGODB_DB'] = MONGODB_DB

Session(app)
ext = Sitemap(app)


from project import routes
6 changes: 3 additions & 3 deletions web/project/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def paper(id):
except Exception as e:
msg = "Exception in paper api " + str(e)
print("Exception in paper api ", e)
return e, 500
return e, 400
return paperdetail

def workflow(id):
Expand All @@ -101,7 +101,7 @@ def workflow(id):
except Exception as e:
msg = "Exception in workflow api " + str(e)
print("Exception in workflow api ", e)
return msg,500
return msg,400
return workflowdetail

def chart(id,cid):
Expand All @@ -118,5 +118,5 @@ def chart(id,cid):
except Exception as e:
msg = "Exception in chart api " + str(e)
print("Exception in chart api ", e)
return msg,500
return msg,400
return chartworkflowdetail
Loading

0 comments on commit c7badf9

Please sign in to comment.