class TruncatedTestCase(unittest.TestCase): def setUp(self): self.d = TruncatedKeyDict(3, foo='bar') def test_zero_keylength(self): d = TruncatedKeyDict(0, foo='bar', bar='baz') self.assertEqual(d['foo'], 'baz') self.assertEqual(d[''], 'baz') def test_basic(self): self.assertEqual(self.d['fooXXX'], 'bar') def test_copy(self): d = self.d.copy() self.assertEqual(d['fooXXX'], 'bar')
def setUp(self): self.d = TruncatedKeyDict(3, foo='bar')
def test_zero_keylength(self): d = TruncatedKeyDict(0, foo='bar', bar='baz') self.assertEqual(d['foo'], 'baz') self.assertEqual(d[''], 'baz')