• Home
  • Raw
  • Download

Lines Matching full:attrs

44     def verify_empty_attrs(self, attrs):  argument
45 self.assertRaises(KeyError, attrs.getValue, "attr")
46 self.assertRaises(KeyError, attrs.getValueByQName, "attr")
47 self.assertRaises(KeyError, attrs.getNameByQName, "attr")
48 self.assertRaises(KeyError, attrs.getQNameByName, "attr")
49 self.assertRaises(KeyError, attrs.__getitem__, "attr")
50 self.assertEqual(attrs.getLength(), 0)
51 self.assertEqual(attrs.getNames(), [])
52 self.assertEqual(attrs.getQNames(), [])
53 self.assertEqual(len(attrs), 0)
54 self.assertFalse(attrs.has_key("attr"))
55 self.assertEqual(attrs.keys(), [])
56 self.assertEqual(attrs.get("attrs"), None)
57 self.assertEqual(attrs.get("attrs", 25), 25)
58 self.assertEqual(attrs.items(), [])
59 self.assertEqual(attrs.values(), [])
61 def verify_empty_nsattrs(self, attrs): argument
62 self.assertRaises(KeyError, attrs.getValue, (ns_uri, "attr"))
63 self.assertRaises(KeyError, attrs.getValueByQName, "ns:attr")
64 self.assertRaises(KeyError, attrs.getNameByQName, "ns:attr")
65 self.assertRaises(KeyError, attrs.getQNameByName, (ns_uri, "attr"))
66 self.assertRaises(KeyError, attrs.__getitem__, (ns_uri, "attr"))
67 self.assertEqual(attrs.getLength(), 0)
68 self.assertEqual(attrs.getNames(), [])
69 self.assertEqual(attrs.getQNames(), [])
70 self.assertEqual(len(attrs), 0)
71 self.assertFalse(attrs.has_key((ns_uri, "attr")))
72 self.assertEqual(attrs.keys(), [])
73 self.assertEqual(attrs.get((ns_uri, "attr")), None)
74 self.assertEqual(attrs.get((ns_uri, "attr"), 25), 25)
75 self.assertEqual(attrs.items(), [])
76 self.assertEqual(attrs.values(), [])
78 def verify_attrs_wattr(self, attrs): argument
79 self.assertEqual(attrs.getLength(), 1)
80 self.assertEqual(attrs.getNames(), ["attr"])
81 self.assertEqual(attrs.getQNames(), ["attr"])
82 self.assertEqual(len(attrs), 1)
83 self.assertTrue(attrs.has_key("attr"))
84 self.assertEqual(attrs.keys(), ["attr"])
85 self.assertEqual(attrs.get("attr"), "val")
86 self.assertEqual(attrs.get("attr", 25), "val")
87 self.assertEqual(attrs.items(), [("attr", "val")])
88 self.assertEqual(attrs.values(), ["val"])
89 self.assertEqual(attrs.getValue("attr"), "val")
90 self.assertEqual(attrs.getValueByQName("attr"), "val")
91 self.assertEqual(attrs.getNameByQName("attr"), "attr")
92 self.assertEqual(attrs["attr"], "val")
93 self.assertEqual(attrs.getQNameByName("attr"), "attr")
743 def startElement(self, name, attrs): argument
744 self._attrs = attrs
746 def startElementNS(self, name, qname, attrs): argument
747 self._attrs = attrs
787 attrs = gather._attrs
789 self.assertEqual(attrs.getLength(), 1)
790 self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
791 self.assertTrue((attrs.getQNames() == [] or
792 attrs.getQNames() == ["ns:attr"]))
793 self.assertEqual(len(attrs), 1)
794 self.assertTrue(attrs.has_key((ns_uri, "attr")))
795 self.assertEqual(attrs.get((ns_uri, "attr")), "val")
796 self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
797 self.assertEqual(attrs.items(), [((ns_uri, "attr"), "val")])
798 self.assertEqual(attrs.values(), ["val"])
799 self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
800 self.assertEqual(attrs[(ns_uri, "attr")], "val")
1009 attrs = AttributesNSImpl({(ns_uri, "attr") : "val"},
1012 self.assertEqual(attrs.getLength(), 1)
1013 self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
1014 self.assertEqual(attrs.getQNames(), ["ns:attr"])
1015 self.assertEqual(len(attrs), 1)
1016 self.assertTrue(attrs.has_key((ns_uri, "attr")))
1017 self.assertEqual(attrs.keys(), [(ns_uri, "attr")])
1018 self.assertEqual(attrs.get((ns_uri, "attr")), "val")
1019 self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
1020 self.assertEqual(attrs.items(), [((ns_uri, "attr"), "val")])
1021 self.assertEqual(attrs.values(), ["val"])
1022 self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
1023 self.assertEqual(attrs.getValueByQName("ns:attr"), "val")
1024 self.assertEqual(attrs.getNameByQName("ns:attr"), (ns_uri, "attr"))
1025 self.assertEqual(attrs[(ns_uri, "attr")], "val")
1026 self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")