def test_translate(self, size):
        trans = string.maketrans('.aZ', '-!$')
        SUBSTR = 'aZz.z.Aaz.'
        sublen = len(SUBSTR)
        repeats = size // sublen + 2
        s = SUBSTR * repeats
        s = s.translate(trans)
        self.assertEquals(len(s), repeats * sublen)
        self.assertEquals(s[:sublen], SUBSTR.translate(trans))
        self.assertEquals(s[-sublen:], SUBSTR.translate(trans))
        self.assertEquals(s.count('.'), 0)
        self.assertEquals(s.count('!'), repeats * 2)
        self.assertEquals(s.count('z'), repeats * 3)