Пример #1
0
 def test_repr_deveria_conter_nome_da_instancia(self):
     menu_item = widget.MenuItem(name="name", url="url")
     self.assertEqual("MenuItem (name=name, url=url)", repr(menu_item))
Пример #2
0
 def test_render_deveria_retornar_html(self):
     html = '<li><a href="url">name</a></li>'
     menu_item = widget.MenuItem(name="name", url="url")
     self.assertEqual(html, menu_item.render())
Пример #3
0
 def test_add_deveria_criar_menu_item_e_adicionar_ao_items(self):
     menu = self.menu("Name")
     menu.add("name", "url")
     self.assertListEqual([widget.MenuItem("name", "url")], menu.items)
Пример #4
0
 def test_init_deveria_criar_atributos_name_e_url(self):
     menu_item = widget.MenuItem(name="name", url="url")
     self.assertEqual("name", menu_item.name)
     self.assertEqual("url", menu_item.url)
Пример #5
0
 def test_add_many_deveria_construir_menu_items_e_adicionar_ao_items(self):
     menu = self.menu("Name")
     menu.add_many(*[("name", "url")])
     self.assertListEqual([widget.MenuItem("name", "url")], menu.items)