69 |
assert map.getAbbrev("mailto:foo@example.org") == "two:example.org" |
assert map.getAbbrev("mailto:foo@example.org") == "two:example.org" |
70 |
assert map.getAbbrev("urn:x-foo:foo") == "urn:x-foo:foo" |
assert map.getAbbrev("urn:x-foo:foo") == "urn:x-foo:foo" |
71 |
|
|
72 |
|
|
73 |
|
def testCompareByAbbrev(): |
74 |
|
map = gzz.loom.NamespaceMap() |
75 |
|
map.put("one", "http://example.com/") |
76 |
|
map.put("two", "mailto:foo@") |
77 |
|
|
78 |
|
cmp = map.getComparator().compare |
79 |
|
|
80 |
|
assert cmp("foo", "foo") == 0 |
81 |
|
assert cmp("foo", "bar") > 0 |
82 |
|
|
83 |
|
assert cmp("kabba", "http://example.com") > 0 |
84 |
|
assert cmp("kabba", "http://example.com/innamespace") < 0 |
85 |
|
|
86 |
|
assert cmp("http://example.com/1", "mailto:foo@example.com") < 0 |
87 |
|
assert cmp("http://example.com/17", "http://example.com/17") == 0 |