Example #1
0
def test_tolatex():
    old_header = _to_latex._header
    old_body = _to_latex._body
    old_footer = _to_latex._footer

    _to_latex._header = lambda x: "H"
    _to_latex._body = lambda x, y: x
    _to_latex._footer = lambda x: "F"

    latex = _to_latex.to_latex("B")
    assert latex == "HBF"

    _to_latex._header = old_header
    _to_latex._body = old_body
    _to_latex._footer = old_footer
Example #2
0
def test_tolatex():
    old_header = _to_latex._header
    old_body = _to_latex._body
    old_footer = _to_latex._footer

    _to_latex._header = lambda x: "H"
    _to_latex._body = lambda x, settings, drawing_order, draw_gates_in_parallel: x
    _to_latex._footer = lambda: "F"

    latex = _to_latex.to_latex("B")
    assert latex == "HBF"

    _to_latex._header = old_header
    _to_latex._body = old_body
    _to_latex._footer = old_footer