Пример #1
0
 def test_mult_neg_real(self):
     self.assertEqual(interpretator(-2.5, '*', 2.0), -5)
Пример #2
0
 def test_add_right_real_numbers(self):
     self.assertEqual(interpretator(1.2, "+", 2.3), 3.5)
Пример #3
0
 def test_sub_with_str(self):
     self.assertEqual(interpretator('4', '-', '2'), 2)
Пример #4
0
 def test_mult_right(self):
     self.assertEqual(interpretator(2, '*', 2), 4)
Пример #5
0
 def test_sub_negative_result(self):
     self.assertEqual(interpretator(10, '-', 20), -10)
Пример #6
0
 def test_sub_real_to_negative(self):
     self.assertEqual(interpretator(2.3, '-', 3.0), -0.7)
Пример #7
0
 def test_right_root(self):
     self.assertEqual(interpretator(4, "root by", 2), 2)
Пример #8
0
 def test_sub_right(self):
     self.assertEqual(interpretator(4, '-', 2), 2)
Пример #9
0
 def test_div_neg(self):
     self.assertEqual(interpretator(-5, '/', 2), -2.5)
Пример #10
0
 def test_div_str(self):
     self.assertEqual(interpretator('12', '/', '2.0'), 6)
Пример #11
0
 def test_div_real_numbers(self):
     self.assertEqual(interpretator(3.2, '/', 0.5), 6.4)
Пример #12
0
 def test_div_right(self):
     self.assertEqual(interpretator(4, '/', 2), 2)
Пример #13
0
 def test_mult_with_str(self):
     self.assertEqual(interpretator('1.2', '*', '2'), 2.4)
Пример #14
0
 def test_add_with_negative(self):
     self.assertEqual(interpretator(2.0, "+", -1.1), 0.9)
Пример #15
0
 def test_rigth_float_root(self):
     self.assertEqual(interpretator(4.0, "root by", 2.0), 2.0)
Пример #16
0
 def test_add_str_interpretation(self):
     self.assertEqual(interpretator('3.7', '+', '1.2'), 4.9)
Пример #17
0
 def test_right_real_float_root(self):
     self.assertEqual(interpretator(0.25, "root by", 2), 0.5)
Пример #18
0
 def test_sub_with_negative(self):
     self.assertEqual(interpretator(1, '-', -1), 2)
Пример #19
0
 def test_root_neg_with_odd_pow(self):
     self.assertEqual(interpretator(-27, "root by", 3), -3)
Пример #20
0
 def test_sub_real_numbers(self):
     self.assertEqual(interpretator(1.9, '-', 0.5), 1.4)
Пример #21
0
 def test_precision_of_root(self):
     self.assertEqual(interpretator(15, "root by", 3), 2.46621207433)
Пример #22
0
 def test_sub_from_zero(self):
     self.assertEqual(interpretator(0, '-', 5), -5)
Пример #23
0
 def test_root_str_param(self):
     self.assertEqual(interpretator('16', "root by", '2'), 4)
Пример #24
0
 def test_sub_from_negative_to_posit(self):
     self.assertEqual(interpretator(-5, '-', -10), 5)
Пример #25
0
 def test_add_right_operands(self):
     self.assertEqual(interpretator(1, "+", 1), 2)
Пример #26
0
 def test_mult_with_neg(self):
     self.assertEqual(interpretator(2, '*', -3), -6)
Пример #27
0
 def test_mult_real_numbers(self):
     self.assertEqual(interpretator(2.5, '*', 2.0), 5)