Skip to content

Commit

Permalink
tests: Update test suite to include cell_10.py for testing numeric li…
Browse files Browse the repository at this point in the history
…ne feature
  • Loading branch information
connorferster committed Nov 22, 2020
1 parent be4b35e commit fe3759e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions test_handcalcs/test_handcalcs_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from test_handcalcs import cell_7b
from test_handcalcs import cell_8
from test_handcalcs import cell_9
from test_handcalcs import cell_10
from test_handcalcs import error_cell


Expand Down Expand Up @@ -145,6 +146,7 @@ def func_2(x, y):
cell_7b_source = remove_imports_defs_and_globals(inspect.getsource(cell_7b))
cell_8_source = remove_imports_defs_and_globals(inspect.getsource(cell_8))
cell_9_source = remove_imports_defs_and_globals(inspect.getsource(cell_9))
cell_10_source = remove_imports_defs_and_globals(inspect.getsource(cell_10))
error_cell_source = remove_imports_defs_and_globals(inspect.getsource(error_cell))

cell_1_renderer = handcalcs.handcalcs.LatexRenderer(
Expand Down Expand Up @@ -180,6 +182,9 @@ def func_2(x, y):
cell_9_renderer = handcalcs.handcalcs.LatexRenderer(
cell_9_source, cell_9.calc_results, line_args_symbolic,
)
cell_10_renderer = handcalcs.handcalcs.LatexRenderer(
cell_10_source, cell_10.calc_results, line_args,
)
# error_cell_renderer = handcalcs.handcalcs.LatexRenderer(
error_cell_renderer = handcalcs.handcalcs.LatexRenderer(
error_cell_source, error_cell.calc_results, line_args,
Expand Down Expand Up @@ -232,9 +237,12 @@ def test_integration():
)
assert (
cell_9_renderer.render()
== "\\[\n\\begin{aligned}\n\\mu &= 0.44 \\; \n\\\\[10pt]\n\\mathrm{CritSeg} &= 1.5 \\; \\;\\textrm{(sendo extramemente)}\n\\\\[10pt]\n\\Delta_{h} &= 9.641 \\; \n\\\\[10pt]\n\\mathrm{Raio} &= \\left( \\frac{ 200 }{ 2 } \\right) \\; \\;\\textrm{(Config)}\n\\\\[10pt]\n\\mathrm{Raio}_{Minimo} &= \\mathrm{CritSeg} \\cdot \\frac{ \\Delta_{h} }{ \\left( \\sin \\left( \\arctan \\left( \\mu + 1 \\right) + 1 \\right) \\right) ^{ 2 } } \\; \n\\end{aligned}\n\\]"
== '\\[\n\\begin{aligned}\n\\mu &= 0.44 \\; \n\\\\[10pt]\n\\mathrm{CritSeg} &= 1.5 \\; \\;\\textrm{(sendo extramemente)}\n\\\\[10pt]\n\\Delta_{h} &= 9.641 \\; \n\\\\[10pt]\n\\mathrm{Raio} &= \\left( \\frac{ 200 }{ 2 } \\right) \\; \\;\\textrm{(Config)}\n\\\\[10pt]\n\\mathrm{Raio}_{Minimo} &= \\mathrm{CritSeg} \\cdot \\frac{ \\Delta_{h} }{ \\left( \\sin \\left( \\arctan \\left( \\mu + 1 \\right) + 1 \\right) \\right) ^{ 2 } } \\; \n\\end{aligned}\n\\]'
)
assert (
cell_10_renderer.render()
== '\\[\n\\begin{aligned}\n\\mu &= 45 + \\frac{ \\sin \\left( 34 + 2 \\right) }{ 2 } &= 44.504 \n\\end{aligned}\n\\]'
)


# Test decorator.py

Expand Down

0 comments on commit fe3759e

Please sign in to comment.