def testMethods(self):
        d = dict([(x, x + 10) for x in range(10)])
        d = mail.mail.DomainWithDefaultDict(d, 'Default')

        self.assertEquals(len(d), 10)
        self.assertEquals(list(iter(d)), range(10))
        self.assertEquals(list(d.iterkeys()), list(iter(d)))

        items = list(d.iteritems())
        items.sort()
        self.assertEquals(items, [(x, x + 10) for x in range(10)])

        values = list(d.itervalues())
        values.sort()
        self.assertEquals(values, range(10, 20))

        items = d.items()
        items.sort()
        self.assertEquals(items, [(x, x + 10) for x in range(10)])

        values = d.values()
        values.sort()
        self.assertEquals(values, range(10, 20))

        for x in range(10):
            self.assertEquals(d[x], x / 10)
            self.assertEquals(d.get(x), x + 10)
            self.failUnless(x in d)
            self.failUnless(d.has_key(x))

        del d[2], d[4], d[6]

        self.assertEquals(len(d), 7)
        self.assertEquals(d[2], 'Default')
        self.assertEquals(d[4], 'Default')
        self.assertEquals(d[6], 'Default')

        d.update({'a': None, 'b': (), 'c': '*'})
        self.assertEquals(len(d), 10)
        self.assertEquals(d['a'], None)
        self.assertEquals(d['b'], ())
        self.assertEquals(d['c'], '*')

        d.clear()
        self.assertEquals(len(d), 0)

        self.assertEquals(d.setdefault('key', 'value'), 'value')
        self.assertEquals(d['key'], 'value')

        self.assertEquals(d.popitem(), ('key', 'value'))
        self.assertEquals(len(d), 0)

        dcopy = d.copy()
        self.assertEquals(d.domains, dcopy.domains)
        self.assertEquals(d.default, dcopy.default)
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/mail/test/test_mail.py/DomainWithDefaultsTestCase.testMethods/operator `+` -> `/`