def runTest(self):
	# Test constructors
        Chaffing.Chaff()
        Chaffing.Chaff(0.5, 1)
        self.assertRaises(ValueError, Chaffing.Chaff, factor=-1)
        self.assertRaises(ValueError, Chaffing.Chaff, blocksper=-1)

        data = [(1, 'data1', 'data1'), (2, 'data2', 'data2')]
        c = Chaffing.Chaff(1.0, 1)
        c.chaff(data)
        chaff = c.chaff(data)
        self.assertEqual(len(chaff), 4)

        c = Chaffing.Chaff(0.0, 1)
        chaff = c.chaff(data)
        self.assertEqual(len(chaff), 2)
Simple tests of chaffing and winnowing
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Protocol/test_chaffing.py/ChaffingTest.runTest