-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forgot to add some files for unit tests
- Loading branch information
1 parent
f1a64c0
commit 703b6f6
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,4 @@ | ||
rm /tmp/panoramix_unittests.db | ||
export PANORAMIX_CONFIG=tests.panoramix_test_config | ||
panoramix/bin/panoramix db upgrade | ||
nosetests tests/core_tests.py --with-coverage --cover-package=panoramix |
Empty file.
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,42 @@ | ||
import imp | ||
import os | ||
import unittest | ||
import urllib2 | ||
os.environ['PANORAMIX_CONFIG'] = 'tests.panoramix_test_config' | ||
from flask.ext.testing import LiveServerTestCase, TestCase | ||
|
||
from panoramix import app, db, models | ||
BASE_DIR = app.config.get("BASE_DIR") | ||
cli = imp.load_source('cli', BASE_DIR + "/bin/panoramix") | ||
|
||
|
||
class LiveTest(TestCase): | ||
|
||
def create_app(self): | ||
app.config['LIVESERVER_PORT'] = 8873 | ||
app.config['TESTING'] = True | ||
return app | ||
|
||
def setUp(self): | ||
print BASE_DIR | ||
|
||
def test_load_examples(self): | ||
cli.load_examples(sample=True) | ||
|
||
def test_slices(self): | ||
Slc = models.Slice | ||
for slc in db.session.query(Slc).all(): | ||
self.client.get(slc.slice_url) | ||
viz = slc.viz | ||
if hasattr(viz, 'get_json'): | ||
self.client.get(viz.get_json()) | ||
|
||
def test_dashboard(self): | ||
for dash in db.session.query(models.Dashboard).all(): | ||
self.client.get(dash.url) | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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,6 @@ | ||
from panoramix.config import * | ||
|
||
AUTH_USER_REGISTRATION_ROLE = 'alpha' | ||
SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/panoramix_unittests.db' | ||
DEBUG = True | ||
PANORAMIX_WEBSERVER_PORT = 8081 |