36:63c9cb7c6bb8
Anton Shestakov <av6@dwimlabs.net>, Sat, 18 Jun 2016 18:56:12 +0800
tests: mock database to be an in-memory db for tests

next change 37:bbce1e45da1e

tests/test_viewer.py

Permissions: -rw-r--r--

Other formats: Feeds:
from mock import Mock
from tornado.testing import AsyncHTTPTestCase
from candolint.models import database, Project, Change, Check
from viewer import CandolintViewer
class ViewerTestCase(AsyncHTTPTestCase):
def get_app(self):
database.init(':memory:')
database.connect()
database.create_tables([Project, Change, Check], safe=True)
database.init = Mock()
database.connect = Mock()
database.disconnect = Mock()
return CandolintViewer()