class TestJulyApp(object): def setUp(self): self.app = JulyApp('test', __name__) def test_first_register(self): assert self.app.first_register() == True assert self.app.first_register() == False def test_add_handler(self): self.app.add_handler(('/', 'TestJulyApp')) assert self.app.handlers == [('/', 'TestJulyApp')]
def test_register_app1(self): app = JulyApp('app1', __name__) app.add_handler(('', 'joking')) self.application.register_app(app, '/app')