def test_multiply_float(self):
     factor_x = 5
     factor_y = 4.0
     expect = 20.0
     self.assertAlmostEqual(multiply(factor_x, factor_y),
                            expect,
                            delta=0.0001)
 def test_multiply_Decimal_number(self):
     inputs = (Decimal('3.4'), Decimal('5.9'))
     expect = Decimal('20.06')
     self.assertEqual(multiply(*inputs), expect)
 def test_multiply_negative_value(self):
     inputs = (2, -5)
     expect = -10
     self.assertEqual(multiply(*inputs), expect)
 def test_multiply_factor_zero(self):
     factor_x = 0
     factor_y = 1
     expect = 0
     self.assertEqual(multiply(factor_x, factor_y), expect)
 def test_multiply_int(self):
     factor_x = 4
     factor_y = 5
     expect = 20
     self.assertEqual(multiply(factor_x, factor_y), expect)
Ejemplo n.º 6
0
 def test_multiply_func(self):
     self.assertEqual(test_simple_calc.multiply(1, 10), 10)
     self.assertEqual(test_simple_calc.multiply(-5, 5), -25)
     self.assertEqual(test_simple_calc.multiply(2.3, 5.6), 12.879999999999999)