class TestPluginModuleRoutes(TestCase): def setUp(self): self.plugin = Plugin('My Plugin', 'my.plugin.id') self.module = Module('mymodule') def test_routes(self): @self.module.route('/') def mock_view(): return 'foo' @self.plugin.route('/') def mock_view2(): return 'bar' self.plugin.register_module(self.module, '/module') self.assertEqual(self.plugin.dispatch('/'), 'bar') self.assertEqual(self.plugin.dispatch('/module/'), 'foo') self.assertEqual(self.plugin.url_for('mock_view2'), 'special://my.plugin.id/') self.assertEqual(self.plugin.url_for('mymodule.mock_view'), 'special://my.plugin.id/module/') self.assertEqual(self.module.url_for('mock_view'), 'special://my.plugin.id/module/') print 'here?'
class TestPluginModuleRoutes(TestCase): def setUp(self): self.plugin = Plugin("My Plugin", "my.plugin.id") self.module = Module("mymodule") def test_routes(self): @self.module.route("/") def mock_view(): return "foo" @self.plugin.route("/") def mock_view2(): return "bar" self.plugin.register_module(self.module, "/module") self.assertEqual(self.plugin.dispatch("/"), "bar") self.assertEqual(self.plugin.dispatch("/module/"), "foo") self.assertEqual(self.plugin.url_for("mock_view2"), "special://my.plugin.id/") self.assertEqual(self.plugin.url_for("mymodule.mock_view"), "special://my.plugin.id/module/") self.assertEqual(self.module.url_for("mock_view"), "special://my.plugin.id/module/") print "here?"
def setUp(self): self.plugin = Plugin('My Plugin', 'my.plugin.id') self.module = Module('mymodule')
def setUp(self): self.plugin = Plugin("My Plugin", "my.plugin.id") self.module = Module("mymodule")