Source code for thriftworker.tests.app.test_state

from __future__ import absolute_import

from thriftworker.tests.utils import TestCase
from thriftworker.state import get_current_app, set_current_app, current_app


[docs]class TestState(TestCase):
[docs] def test_no_app_created(self): with self.assertRaises(RuntimeError): get_current_app()
[docs] def test_change_app(self): some_app = object() set_current_app(some_app) self.assertIs(some_app, get_current_app())
[docs] def test_current_app(self): some_app = object() set_current_app(some_app) self.assertIs(some_app, current_app._get_current_object())
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.