Пример #1
0
 def test_that_illegal_number_of_arguments_cant_be_passed_into_the_division_method(
         self):
     with self.assertRaises(TypeError):
         self.assertEqual(Calculator.divide(4, 2, 1), 2)
Пример #2
0
 def test_that_divide_result_type_is_int(self):
     self.assertEqual(int, type(Calculator.divide(2, 3)))
     self.assertIsInstance(Calculator.divide(2, 3), int)
Пример #3
0
 def test_that_non_int_cannot_be_divided_by_int(self):
     with self.assertRaises(TypeError):
         Calculator.divide("1", 1)
Пример #4
0
 def test_that_method_can_divide_two_numbers(self):
     self.assertEqual(0, Calculator.divide(2, 3))