Exemplo n.º 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"
Exemplo n.º 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"
Exemplo n.º 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")
Exemplo n.º 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")