def testMatch_02(self): p = TreeDict() p.aa = 1 p.bb = 1 self.assert_(p.getClosestKey('a') == 'aa') self.assert_(p.getClosestKey('a',1) == ['aa'])