Doveps / mono

Code for Doveps projects
http://doveps.com
MIT License
0 stars 0 forks source link

03-08-2018 Report: Setup SQLAlchemy in test cases #126

Closed JosiahRegencia closed 6 years ago

JosiahRegencia commented 6 years ago

Working on this for issue #119

Skipped the redo of query.py

Followed this link: https://julien.danjou.info/blog/2014/db-integration-testing-strategies-python

That is to setup sqlalchemy in the test cases.

Added a .sh file to create a database before hand. Found a potential solution here:https://forums.freebsd.org/threads/how-to-call-an-external-sh-file-from-within-python-in-freebsd.52461/

Still confusing how to let python execute .sh files. My bet is that if I can setup sqlalchemy properly in def setUp(), the json results would be correct.

greenmoss commented 6 years ago

Can you give more info on what db you are creating beforehand? Is it for testing only? Normally the db creation scripts go here:

https://github.com/Doveps/mono/tree/master/db/scripts

Any script you add there will be automatically called when the db starts. That includes creating functions, dbs, etc.