def testMulSelfOne(self): mod2 = operations.Modulus2(1) self.assertEqual(mod2 * 0, 0) self.assertEqual(mod2 * 1, 1)
def testMulSelfZero(self): mod2 = operations.Modulus2(0) self.assertEqual(mod2 * 0, 0) self.assertEqual(mod2 * 1, 0)
def testAddSelfOne(self): mod2 = operations.Modulus2(1) self.assertEqual(mod2 + 0, 1) self.assertEqual(mod2 + 1, 0)
def testAddSelfZero(self): mod2 = operations.Modulus2(0) self.assertEqual(mod2 + 0, 0) self.assertEqual(mod2 + 1, 1)
def testInitOne(self): mod2 = operations.Modulus2(1) self.assertEqual(mod2.datum, 1)
def testInitNothing(self): mod2 = operations.Modulus2() self.assertEqual(mod2.datum, 0)