def test_normalize_names_with_trailing_sep(self): d = NamespaceDict({'/foo/bar/': 'baz'}) self.assertTrue(d.has_key('/foo/bar')) self.assertTrue(d.has_key('/foo/bar/')) self.assertSetEqual(set(['/foo/bar', '/foo', '/']), d.keys()) self.assertEqual('baz', d['/foo/bar/'])
def test_has_key(self): d = NamespaceDict({'/foo/bar': 'baz'}) self.assertTrue(d.has_key('/foo/bar')) self.assertTrue(d.has_key('/foo/bar/'))