def test_get_attr_value(): t = Tag('<t n1=v1 n2=v2 n1=v3 n2=v4>c</t>') assert t.get_attr('n1') == 'v3' assert t.get_attr('n2') == 'v4' t = Tag('<t a>c</t>') assert t.get_attr('a') == '' assert t.get_attr('z') is None
def test_get_attr_value(self): t = Tag('<t n1=v1 n2=v2 n1=v3 n2=v4>c</t>') self.assertEqual(t.get_attr('n1'), 'v3') self.assertEqual(t.get_attr('n2'), 'v4') t = Tag('<t a>c</t>') self.assertEqual(t.get_attr('a'), '') self.assertEqual(t.get_attr('z'), None)