MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_expat_nsattrs_wattr

Method test_expat_nsattrs_wattr

Lib/test/test_sax.py:1121–1142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1119
1120 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'
1121 def test_expat_nsattrs_wattr(self):
1122 parser = create_parser(1)
1123 gather = self.AttrGatherer()
1124 parser.setContentHandler(gather)
1125
1126 parser.feed("<doc xmlns:ns='%s' ns:attr='val'/>" % ns_uri)
1127 parser.close()
1128
1129 attrs = gather._attrs
1130
1131 self.assertEqual(attrs.getLength(), 1)
1132 self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
1133 self.assertTrue((attrs.getQNames() == [] or
1134 attrs.getQNames() == ["ns:attr"]))
1135 self.assertEqual(len(attrs), 1)
1136 self.assertIn((ns_uri, "attr"), attrs)
1137 self.assertEqual(attrs.get((ns_uri, "attr")), "val")
1138 self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
1139 self.assertEqual(list(attrs.items()), [((ns_uri, "attr"), "val")])
1140 self.assertEqual(list(attrs.values()), ["val"])
1141 self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
1142 self.assertEqual(attrs[(ns_uri, "attr")], "val")
1143
1144 # ===== InputSource support
1145

Callers

nothing calls this directly

Calls 15

create_parserFunction · 0.90
lenFunction · 0.85
listClass · 0.85
getLengthMethod · 0.80
getNamesMethod · 0.80
assertTrueMethod · 0.80
assertInMethod · 0.80
getValueMethod · 0.80
setContentHandlerMethod · 0.45
feedMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected