예제 #1
0
 def test_number_zero(self):
     self.assertEqual(decimalBaseConvert(0, 8), "0")
예제 #2
0
 def test_base_lower_than_2(self):
     with self.assertRaises(ValueError):
         decimalBaseConvert(165, -2)
예제 #3
0
 def test_base_higher_than_16(self):
     with self.assertRaises(ValueError):
         decimalBaseConvert(45, 17)
예제 #4
0
 def test_decimal_to_hexadecimal(self):
     self.assertEqual(decimalBaseConvert(15, 16), "F")
예제 #5
0
 def test_decimal_to_octal(self):
     self.assertEqual(decimalBaseConvert(21, 8), "25")
예제 #6
0
 def test_decimal_to_binary(self):
     self.assertEqual(decimalBaseConvert(12, 2), "1100")