provide config.py in tests folder
This commit is contained in:
parent
2986d426bb
commit
90da2aafcd
2 changed files with 17 additions and 2 deletions
14
tests/config.py
Normal file
14
tests/config.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# py-scopes/tests/config.py
|
||||||
|
|
||||||
|
from scopes.server.app import demo_app, zope_app
|
||||||
|
|
||||||
|
# server / app settings
|
||||||
|
server_port = '8999'
|
||||||
|
app = zope_app
|
||||||
|
|
||||||
|
# storage settings
|
||||||
|
dbengine = 'postgresql+psycopg'
|
||||||
|
dbname = 'testdb'
|
||||||
|
dbuser = 'testuser'
|
||||||
|
dbpassword = 'secret'
|
||||||
|
|
|
@ -11,7 +11,8 @@ from scopes.storage.common import Storage, getEngine, sessionFactory
|
||||||
from scopes.storage import proxy
|
from scopes.storage import proxy
|
||||||
from scopes.storage import tracking
|
from scopes.storage import tracking
|
||||||
|
|
||||||
engine = getEngine('postgresql+psycopg', 'testdb', 'testuser', 'secret')
|
import config
|
||||||
|
engine = getEngine(config.dbengine, config.dbname, config.dbuser, config.dbpassword)
|
||||||
scopes.storage.common.engine = engine
|
scopes.storage.common.engine = engine
|
||||||
scopes.storage.common.Session = sessionFactory(engine)
|
scopes.storage.common.Session = sessionFactory(engine)
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ storage = Storage(schema='testing')
|
||||||
class Test(unittest.TestCase):
|
class Test(unittest.TestCase):
|
||||||
"Basic tests for the cco.storage package."
|
"Basic tests for the cco.storage package."
|
||||||
|
|
||||||
def testBasicStuff(self):
|
def testTracking(self):
|
||||||
storage.dropTable('tracks')
|
storage.dropTable('tracks')
|
||||||
tracks = storage.create(tracking.Container)
|
tracks = storage.create(tracking.Container)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue