def setUp(self): super().setUp() reset() # I don't know why, but need reset for aiohttp. from wdom.examples.timer import sample_app document = get_document() document.body.prepend(sample_app()) self.start()
def setUp(self): super().setUp() reset() # I don't know why, but need reset for aiohttp. document = get_document() self.h1 = H1() self.h1.textContent = 'TITLE' document.body.appendChild(self.h1) self.start()
def test_initialize(self): from wdom.server import _tornado old_doc = get_document() old_app_tornado = _tornado.get_app() testing.reset() self.assertIsNot(old_doc, get_document()) self.assertIsNot(old_app_tornado, _tornado.get_app()) try: from wdom.server import _aiohttp old_app_aio = _aiohttp.get_app() testing.reset() self.assertIsNot(old_app_aio, _aiohttp.get_app()) except ImportError: pass