示例#1
0
 def testMulSelfOne(self):
     mod2 = operations.Modulus2(1)
     self.assertEqual(mod2 * 0, 0)
     self.assertEqual(mod2 * 1, 1)
示例#2
0
 def testMulSelfZero(self):
     mod2 = operations.Modulus2(0)
     self.assertEqual(mod2 * 0, 0)
     self.assertEqual(mod2 * 1, 0)
示例#3
0
 def testAddSelfOne(self):
     mod2 = operations.Modulus2(1)
     self.assertEqual(mod2 + 0, 1)
     self.assertEqual(mod2 + 1, 0)
示例#4
0
 def testAddSelfZero(self):
     mod2 = operations.Modulus2(0)
     self.assertEqual(mod2 + 0, 0)
     self.assertEqual(mod2 + 1, 1)
示例#5
0
 def testInitOne(self):
     mod2 = operations.Modulus2(1)
     self.assertEqual(mod2.datum, 1)
示例#6
0
 def testInitNothing(self):
     mod2 = operations.Modulus2()
     self.assertEqual(mod2.datum, 0)