Пример #1
0
	def test_calc_simple(self):
		"""
		Test the built-in python calculator with a simple expression - 2+2
		"""
		res = commands.calc("2+2")
		print(res)
		assert res == "4"
Пример #2
0
	def test_calc_simple(self):
		"""
		Test the built-in python calculator with a simple expression - 2+2
		"""
		res = commands.calc("2+2")
		print(res)
		assert res == "4"
Пример #3
0
	def test_calc_complex(self):
		"""
		Test the built-in python calculator with a more complicated formula
		((((781**2)*5)/92835.3)+4)**0.5
		"""
		res = commands.calc("((((781**2)*5)/92835.3)+4)**0.5")
		print(res)
		assert res.startswith("6.070566")
Пример #4
0
	def test_calc_complex(self):
		"""
		Test the built-in python calculator with a more complicated formula
		((((781**2)*5)/92835.3)+4)**0.5
		"""
		res = commands.calc("((((781**2)*5)/92835.3)+4)**0.5")
		print(res)
		assert res.startswith("6.070566")