MCPcopy
hub / github.com/csev/py4e / test_attribute_modification

Method test_attribute_modification

code3/bs4/tests/test_tree.py:733–740  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

731class TestTreeModification(SoupTest):
732
733 def test_attribute_modification(self):
734 soup = self.soup('<a id="1"></a>')
735 soup.a['id'] = 2
736 self.assertEqual(soup.decode(), self.document_for('<a id="2"></a>'))
737 del(soup.a['id'])
738 self.assertEqual(soup.decode(), self.document_for('<a></a>'))
739 soup.a['id2'] = 'foo'
740 self.assertEqual(soup.decode(), self.document_for('<a id2="foo"></a>'))
741
742 def test_new_tag_creation(self):
743 builder = builder_registry.lookup('html')()

Callers

nothing calls this directly

Calls 3

soupMethod · 0.45
decodeMethod · 0.45
document_forMethod · 0.45

Tested by

no test coverage detected