16 lines
650 B
Python
16 lines
650 B
Python
|
import mapytex
|
||
|
|
||
|
def test_generate_expression():
|
||
|
random_expression = mapytex.random.expression("{a}+{b}")
|
||
|
assert type(random_expression).__name__ == "Expression"
|
||
|
random_expression = mapytex.random.expression("{a}/{b}")
|
||
|
assert type(random_expression).__name__ == "Fraction"
|
||
|
|
||
|
def test_generate_expression_calculus():
|
||
|
random_expression = mapytex.random.expression("{a}+{a*b}")
|
||
|
assert type(random_expression).__name__ == "Expression"
|
||
|
random_expression = mapytex.random.expression("{a}/{a*b}")
|
||
|
assert type(random_expression).__name__ == "Fraction"
|
||
|
assert random_expression.denominator / random_expression.numerator >=1
|
||
|
|