Пример #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")