コード例 #1
0
 def test_subtract_float_numbers(self):
     minuend = 10.0
     subtrahend = 5
     expect = 5.0
     self.assertAlmostEqual(subtract(minuend, subtrahend),
                            expect,
                            delta=0.0001)
コード例 #2
0
 def test_subtract_minuend_zero(self):
     inputs = (0, 20)
     expect = -20
     self.assertEqual(subtract(*inputs), expect)
コード例 #3
0
 def test_subtract_Decimal_numbers(self):
     inputs = Decimal('5.8'), Decimal('5.9'),
     expect = Decimal('-0.1')
     self.assertEqual(subtract(*inputs), expect)
コード例 #4
0
 def test_subtract_negative_number(self):
     minuend = -10
     subtrahend = 5
     expect = -15
     self.assertEqual(subtract(minuend, subtrahend), expect)
コード例 #5
0
 def test_subtract_integer_numbers(self):
     minuend = 10
     subtrahend = 5
     expect = 5
     self.assertEqual(subtract(minuend, subtrahend), expect)
コード例 #6
0
 def test_substract_func(self):
     self.assertEqual(test_simple_calc.subtract(5, 3), 2)
     self.assertEqual(test_simple_calc.subtract(2.1, 1.1), 1.0)
     self.assertEqual(test_simple_calc.subtract(-10, 100), -110)