def test_app_process_index(self): save_dir = os.getcwd() try: os.chdir(zoom.tools.zoompath(self.apps_dir, 'sample')) app = zoom.App() request = build('http://localhost/sample', {}) request.site = zoom.sites.Site() response = app(request) self.assertEqual(type(response), zoom.Page) finally: os.chdir(save_dir)
def test_app_process_module(self): save_dir = os.getcwd() try: os.chdir(zoom.tools.zoompath('web/apps/sample')) app = zoom.App() request = build('http://localhost/sample/parts', {}) request.site = zoom.site.Site(self.request) request.site.db = zoom.database.setup_test() response = app(request) self.assertEqual(type(response), zoom.Page) finally: os.chdir(save_dir)
def test_app_process_method(self): save_dir = os.getcwd() try: os.chdir(zoom.tools.zoompath(self.apps_dir, 'sample')) app = zoom.App() request = build('http://localhost/sample/about', {}) request.site = zoom.site.Site(self.request) request.site.db = zoom.database.setup_test() response = app(request) self.assertEqual(type(response), str) finally: os.chdir(save_dir)
import zoom app = zoom.App()
""" Main App Module This is the entrypoint to every app. """ import zoom app = zoom.App(['Overview', 'About'])