def test_constructor_overwrite_options(self): name1 = self.app.name class Dummy: name = 'Test' app.Mamba().initialized = False app_tmp = app.Mamba(Dummy()) if GNU_LINUX: self.addCleanup( app_tmp.managers.get('controller').notifier.loseConnection) self.addCleanup( self.app.managers.get('model').notifier.loseConnection) self.assertNotEqual(name1, app_tmp.name)
def setUp(self): self.app = app.Mamba() if GNU_LINUX: self.addCleanup( self.app.managers.get('controller').notifier.loseConnection) self.addCleanup( self.app.managers.get('model').notifier.loseConnection)
def test_get_client_ip_is_monkey_patched(self): mamba = app.Mamba() if GNU_LINUX: self.addCleanup( mamba.managers['controller'].notifier.loseConnection) self.addCleanup(mamba.managers['model'].notifier.loseConnection) from twisted.web.http import Request self.assertEqual(Request.getClientIP.__name__, 'getClientIPPatch')
def _get_script(self, ignore): """ Return the LESS script and set Application use of LESS compiler script as True """ from mamba.application import app mamba_app = app.Mamba() mamba_app.lessjs = True return filepath.FilePath(self.stylesheet).getContent().decode('utf-8')