示例#1
0
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')
示例#2
0
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')
示例#3
0
 def setUp(self):
     self.d = TruncatedKeyDict(3, foo='bar')
示例#4
0
 def test_zero_keylength(self):
     d = TruncatedKeyDict(0, foo='bar', bar='baz')
     self.assertEqual(d['foo'], 'baz')
     self.assertEqual(d[''], 'baz')
示例#5
0
 def setUp(self):
     self.d = TruncatedKeyDict(3, foo='bar')