コード例 #1
0
 def test_positive_negative_integer_divide(self):
     """Testing division of positive and negative integers"""
     new_operation = Operation("division", self.positive_integer,
                               self.negative_integer)
     self.assertEqual(new_operation.operation_result(), -1.0227272727272727)
コード例 #2
0
 def test_positive_integer_float_divide(self):
     """Testing division of positive integer and float"""
     new_operation = Operation("division", self.positive_integer,
                               self.positive_float)
     self.assertEqual(new_operation.operation_result(), 1.9580558333094016)
コード例 #3
0
 def test_positive_negative_integer_multiply(self):
     """Testing multiplication of positive and negative integers"""
     new_operation = Operation("multiplication", self.positive_integer,
                               self.negative_integer)
     self.assertEqual(new_operation.operation_result(), -7920)
コード例 #4
0
 def test_positive_integer_float_multiply(self):
     """Testing multiplication of positive integer and float"""
     new_operation = Operation("multiplication", self.positive_integer,
                               self.positive_float)
     self.assertEqual(new_operation.operation_result(), 4136.7564)
コード例 #5
0
 def test_positive_integer_float_subtract(self):
     """Testing subtract of positive integer and float"""
     new_operation = Operation("subtraction", self.positive_integer,
                               self.positive_float)
     self.assertEqual(new_operation.operation_result(), 44.03604)
コード例 #6
0
 def test_positive_negative_integer_subtract(self):
     """Testing subtract of positive and negative integers"""
     new_operation = Operation("subtraction", self.positive_integer,
                               self.negative_integer)
     self.assertEqual(new_operation.operation_result(), 178)
コード例 #7
0
 def test_positive_integer_float_sum(self):
     """Testing sum of positive integer and float"""
     new_operation = Operation("addition", self.positive_integer,
                               self.positive_float)
     self.assertEqual(new_operation.operation_result(), 135.96396)
コード例 #8
0
 def test_positive_integer_sum(self):
     """Testing sum of positive integers"""
     new_operation = Operation("addition", self.positive_integer,
                               self.positive_integer)
     self.assertEqual(new_operation.operation_result(), 180)
コード例 #9
0
    def button_equal(self):
        second_number = int(self.e.get())
        self.e.delete(0, END)

        new_result = Operation(self.math, self.f_num, second_number)
        self.e.insert(0, new_result.operation_result())