-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f27a168
commit 9e88a76
Showing
4 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
__author__ = "María Andrea Vignau ([email protected])" | ||
__copyright__ = "(C) 2016 María Andrea Vignau. GNU GPL 3." | ||
|
||
import os | ||
from gluon.contrib.markdown.markdown2 import markdown | ||
from gluon.tools import * | ||
|
||
|
@@ -22,9 +23,12 @@ | |
tsv_with_hidden_cols=False, | ||
tsv=False, | ||
json=False) | ||
|
||
|
||
db = DAL('sqlite://openlex.sqlite') | ||
# import pdb; breakpoint() | ||
if os.getenv('WEB2PY_USE_DB_TESTING'): | ||
temp_dir = '/dev/shm' | ||
db = DAL('sqlite://testing.sqlite', folder=temp_dir) | ||
else: | ||
db = DAL('sqlite://openlex.sqlite') | ||
|
||
auth = Auth(globals(), db) | ||
auth.define_tables() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[pytest] | ||
# To run chrome with UI pass --headed | ||
addopts = --browser chromium --base-url=http://127.0.0.1:8000/OpenLex/ | ||
addopts = --browser chromium --base-url=http://127.0.0.1:8020/OpenLex/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# this variable can be used on creating database | ||
export WEB2PY_USE_DB_TESTING="True" | ||
# default port_number | ||
PORT_NUMBER=8020 | ||
# remove all temporary in memory files | ||
rm -f /dev/shm/*.table | ||
rm -f /dev/shm/sql.log | ||
rm -f /dev/shm/testing.sqlite | ||
# run web2py | ||
python ../../web2py.py -a 123 -p ${PORT_NUMBER} --no_gui & | ||
# run tests | ||
fades -r requirements.txt -x pytest -v --pdb | ||
# kill web2py | ||
fuser -k -TERM -n tcp ${PORT_NUMBER} > /dev/null | ||
# clear environment variable | ||
unset WEB2PY_USE_DB_TESTING |