python package restructuring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
import tool_functions
|
||||
|
||||
import chatbug.tool_functions as tool_functions
|
||||
from tests import helper
|
||||
|
||||
|
||||
def test_math_evaluate_1():
|
||||
@@ -28,6 +28,13 @@ def test_math_evaluate_5():
|
||||
result = tool_functions.math_evaluate("sin(pi/2) + cos(0)")
|
||||
assert result == "sin(pi/2) + cos(0) = 2"
|
||||
|
||||
def test_math_evaluate_solve_a():
|
||||
result = tool_functions.math_evaluate("solve 240=x*r+x*r^2+x*r^3+s and r=1.618 and s=5 for x, r, s")
|
||||
assert result == "Solved equation system 240 = r**3*x + r**2*x + r*x + s, r = 1.61800000000000 and s = 5 for x=27.7393327937747=~27.739, r=1.61800000000000=~1.618 and s=5.00000000000000=~5.000."
|
||||
|
||||
def test_math_evaluate_solve_b():
|
||||
result = tool_functions.math_evaluate("solve 250=x+x*r+s and r=1.618 and s=0 for x, r, s")
|
||||
assert result == "Solved equation system 250 = r*x + s + x, r = 1.61800000000000 and s = 0 for x=95.4927425515661=~95.493, r=1.61800000000000=~1.618 and s=0."
|
||||
|
||||
|
||||
|
||||
@@ -54,4 +61,3 @@ def test_math_solver_3b():
|
||||
def test_math_solver_4():
|
||||
result = tool_functions.math_evaluate("solve 2*x**3 + 3*y = 7 and x - y = 1 for x, y")
|
||||
assert result == "Solved equation system 2*x**3 + 3*y = 7 and x - y = 1 for x=~1.421 and y=~0.421."
|
||||
|
||||
|
Reference in New Issue
Block a user