def testBinBigNegative(self):
     self.assertEqual(calculator.bin(-4294967296L), "0b...11100000000000000000000000000000000")
     self.assertEqual(calculator.bin(-11453246123L), "0b...1110101010101010101010101010101010101")
 def testBinNegative(self):
     self.assertEqual(calculator.bin(-2), "0b...1110")
     self.assertEqual(calculator.bin(-1), "0b...111")
 def testBinBigPositive(self):
     self.assertEqual(calculator.bin(4294967296L), "0b100000000000000000000000000000000")
     self.assertEqual(calculator.bin(11453246122L), "0b1010101010101010101010101010101010")
 def testBinPositive(self):
     self.assertEqual(calculator.bin(42), "0b101010")
     self.assertEqual(calculator.bin(511), "0b111111111")
 def testBinZero(self):
     self.assertEqual(calculator.bin(0), "0b0")
示例#6
0
 def testBinNegative(self):
     self.assertEqual(calculator.bin(-2), "0b...1110")
     self.assertEqual(calculator.bin(-1), "0b...111")
示例#7
0
 def testBinPositive(self):
     self.assertEqual(calculator.bin(42), "0b101010")
     self.assertEqual(calculator.bin(511), "0b111111111")
示例#8
0
 def testBinZero(self):
     self.assertEqual(calculator.bin(0), "0b0")