Exemplo n.º 1
0
 def test_zero_division(self):
     with self.assertRaises(ZeroDivisionError):
         Calculator.quotient(30, 0)
Exemplo n.º 2
0
 def test_divide_result_type(self):
     self.assertIsInstance(Calculator.quotient(30, 5), float)
     self.assertIsInstance(Calculator.quotient(15, 5), float)
     self.assertIsInstance(Calculator.quotient(34, 10), float)
Exemplo n.º 3
0
 def test_divide_non_int_type(self):
     with self.assertRaises(TypeError):
         Calculator.quotient(30, "r")
Exemplo n.º 4
0
 def test_divide_result(self):
     self.assertEqual(Calculator.quotient(30, 5), 6)
     self.assertEqual(Calculator.quotient(15, 5), 3)
     self.assertEqual(Calculator.quotient(20, 2), 10)