-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from mvexel/master
API changes
- Loading branch information
Showing
7 changed files
with
132 additions
and
74 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from werkzeug.contrib.profiler import ProfilerMiddleware | ||
from maproulette import app | ||
|
||
app.config['PROFILE'] = True | ||
app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions=[30]) | ||
app.run(debug=True) |
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,20 +1,27 @@ | ||
import os | ||
import maproulette | ||
from maproulette import app | ||
from maproulette.models import db | ||
import unittest | ||
import tempfile | ||
|
||
|
||
class MapRouletteTestCase(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.db_fd, maproulette.app.config['DATABASE'] = tempfile.mkstemp() | ||
maproulette.app.config['TESTING'] = True | ||
self.app = maproulette.app.test_client() | ||
maproulette.init_db() | ||
self.db_fd, app.config['DATABASE'] = tempfile.mkstemp() | ||
app.config['TESTING'] = True | ||
self.app = app.test_client() | ||
db.create_all() | ||
|
||
def tearDown(self): | ||
db.drop_all() | ||
os.close(self.db_fd) | ||
os.unlink(maproulette.app.config['DATABASE']) | ||
os.unlink(app.config['DATABASE']) | ||
|
||
def test_empty_db(self): | ||
r = self.app.get('/api/challenges') | ||
assert r.data.startswith('[]') | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |