Home | History | Annotate | Download | only in test

Lines Matching refs:attrs

42     def verify_empty_attrs(self, attrs):
43 self.assertRaises(KeyError, attrs.getValue, "attr")
44 self.assertRaises(KeyError, attrs.getValueByQName, "attr")
45 self.assertRaises(KeyError, attrs.getNameByQName, "attr")
46 self.assertRaises(KeyError, attrs.getQNameByName, "attr")
47 self.assertRaises(KeyError, attrs.__getitem__, "attr")
48 self.assertEqual(attrs.getLength(), 0)
49 self.assertEqual(attrs.getNames(), [])
50 self.assertEqual(attrs.getQNames(), [])
51 self.assertEqual(len(attrs), 0)
52 self.assertFalse(attrs.has_key("attr"))
53 self.assertEqual(attrs.keys(), [])
54 self.assertEqual(attrs.get("attrs"), None)
55 self.assertEqual(attrs.get("attrs", 25), 25)
56 self.assertEqual(attrs.items(), [])
57 self.assertEqual(attrs.values(), [])
59 def verify_empty_nsattrs(self, attrs):
60 self.assertRaises(KeyError, attrs.getValue, (ns_uri, "attr"))
61 self.assertRaises(KeyError, attrs.getValueByQName, "ns:attr")
62 self.assertRaises(KeyError, attrs.getNameByQName, "ns:attr")
63 self.assertRaises(KeyError, attrs.getQNameByName, (ns_uri, "attr"))
64 self.assertRaises(KeyError, attrs.__getitem__, (ns_uri, "attr"))
65 self.assertEqual(attrs.getLength(), 0)
66 self.assertEqual(attrs.getNames(), [])
67 self.assertEqual(attrs.getQNames(), [])
68 self.assertEqual(len(attrs), 0)
69 self.assertFalse(attrs.has_key((ns_uri, "attr")))
70 self.assertEqual(attrs.keys(), [])
71 self.assertEqual(attrs.get((ns_uri, "attr")), None)
72 self.assertEqual(attrs.get((ns_uri, "attr"), 25), 25)
73 self.assertEqual(attrs.items(), [])
74 self.assertEqual(attrs.values(), [])
76 def verify_attrs_wattr(self, attrs):
77 self.assertEqual(attrs.getLength(), 1)
78 self.assertEqual(attrs.getNames(), ["attr"])
79 self.assertEqual(attrs.getQNames(), ["attr"])
80 self.assertEqual(len(attrs), 1)
81 self.assertTrue(attrs.has_key("attr"))
82 self.assertEqual(attrs.keys(), ["attr"])
83 self.assertEqual(attrs.get("attr"), "val")
84 self.assertEqual(attrs.get("attr", 25), "val")
85 self.assertEqual(attrs.items(), [("attr", "val")])
86 self.assertEqual(attrs.values(), ["val"])
87 self.assertEqual(attrs.getValue("attr"), "val")
88 self.assertEqual(attrs.getValueByQName("attr"), "val")
89 self.assertEqual(attrs.getNameByQName("attr"), "attr")
90 self.assertEqual(attrs["attr"], "val")
91 self.assertEqual(attrs.getQNameByName("attr"), "attr")
547 def startElement(self, name, attrs):
548 self._attrs = attrs
550 def startElementNS(self, name, qname, attrs):
551 self._attrs = attrs
591 attrs = gather._attrs
593 self.assertEqual(attrs.getLength(), 1)
594 self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
595 self.assertTrue((attrs.getQNames() == [] or
596 attrs.getQNames() == ["ns:attr"]))
597 self.assertEqual(len(attrs), 1)
598 self.assertTrue(attrs.has_key((ns_uri, "attr")))
599 self.assertEqual(attrs.get((ns_uri, "attr")), "val")
600 self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
601 self.assertEqual(attrs.items(), [((ns_uri, "attr"), "val")])
602 self.assertEqual(attrs.values(), ["val"])
603 self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
604 self.assertEqual(attrs[(ns_uri, "attr")], "val")
811 attrs = AttributesNSImpl({(ns_uri, "attr") : "val"},
814 self.assertEqual(attrs.getLength(), 1)
815 self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
816 self.assertEqual(attrs.getQNames(), ["ns:attr"])
817 self.assertEqual(len(attrs), 1)
818 self.assertTrue(attrs.has_key((ns_uri, "attr")))
819 self.assertEqual(attrs.keys(), [(ns_uri, "attr")])
820 self.assertEqual(attrs.get((ns_uri, "attr")), "val")
821 self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
822 self.assertEqual(attrs.items(), [((ns_uri, "attr"), "val")])
823 self.assertEqual(attrs.values(), ["val"])
824 self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
825 self.assertEqual(attrs.getValueByQName("ns:attr"), "val")
826 self.assertEqual(attrs.getNameByQName("ns:attr"), (ns_uri, "attr"))
827 self.assertEqual(attrs[(ns_uri, "attr")], "val")
828 self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")