Пример #1
0
 def test_eval_mixed_ops(self):
     x = 'print eval 1*3+10+3-2/2+(3+2)'
     output = capture_gb_eval_print(x)
     self.assertEqual(output, '20.0')
Пример #2
0
 def test_eval_times(self):
     x = 'print eval 3*2'
     output = capture_gb_eval_print(x)
     self.assertEqual(output, '6')
Пример #3
0
 def test_eval_divide(self):
     x = 'print eval 10/2'
     output = capture_gb_eval_print(x)
     self.assertEqual(output, '5.0')
Пример #4
0
 def test_eval_add(self):
     x = 'print eval 1+2'
     output = capture_gb_eval_print(x)
     self.assertEqual(output, '3')
Пример #5
0
 def test_eval_minus(self):
     x = 'print eval 3-2'
     output = capture_gb_eval_print(x)
     self.assertEqual(output, '1')
Пример #6
0
 def test_eval_mixed_ops(self):
     x = "print eval 1*3+10+3-2/2"
     output = capture_gb_eval_print(x)
     self.assertEqual(output, "15.0")
Пример #7
0
 def test_eval_divide(self):
     x = "print eval 10/2"
     output = capture_gb_eval_print(x)
     self.assertEqual(output, "5.0")
Пример #8
0
 def test_eval_times(self):
     x = "print eval 3*2"
     output = capture_gb_eval_print(x)
     self.assertEqual(output, "6")
Пример #9
0
 def test_eval_minus(self):
     x = "print eval 3-2"
     output = capture_gb_eval_print(x)
     self.assertEqual(output, "1")
Пример #10
0
 def test_eval_add(self):
     x = "print eval 1+2"
     output = capture_gb_eval_print(x)
     self.assertEqual(output, "3")