def test_sitemap(): sm = app.SitemapEntry('test', '')[ app.SitemapEntry('a', 'a/'), app.SitemapEntry('b', 'b/')] sm[app.SitemapEntry(lambda app:app.config.script_name(), 'c/')] bound_sm = sm.bind_app(c.app) assert bound_sm.url == 'http://testproject/test_application/', bound_sm.url assert bound_sm.children[-1].label == '/testproject/test_application/', bound_sm.children[-1].label assert len(sm.children) == 3 sm.extend([app.SitemapEntry('a', 'a/')[ app.SitemapEntry('d', 'd/')]]) assert len(sm.children) == 3
def sitemap(self): children = [ app.SitemapEntry('New', 'new', ui_icon=Icon('some-icon')), app.SitemapEntry('Recent', 'recent'), ] return [app.SitemapEntry('My Tool', '.')[children]]