mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
fix latex test
This commit is contained in:
parent
cc4b9938c7
commit
e5ed110d65
1 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ def test_latex():
|
||||||
d = getEmptyDeck()
|
d = getEmptyDeck()
|
||||||
# change latex cmd to simulate broken build
|
# change latex cmd to simulate broken build
|
||||||
import anki.latex
|
import anki.latex
|
||||||
anki.latex.latexCmd[0] = "nolatex"
|
anki.latex.latexCmds[0][0] = "nolatex"
|
||||||
# add a note with latex
|
# add a note with latex
|
||||||
f = d.newNote()
|
f = d.newNote()
|
||||||
f['Front'] = u"[latex]hello[/latex]"
|
f['Front'] = u"[latex]hello[/latex]"
|
||||||
|
@ -17,7 +17,7 @@ def test_latex():
|
||||||
assert len(os.listdir(d.media.dir())) == 0
|
assert len(os.listdir(d.media.dir())) == 0
|
||||||
# check the error message
|
# check the error message
|
||||||
msg = f.cards()[0].q()
|
msg = f.cards()[0].q()
|
||||||
assert "executing latex" in msg
|
assert "executing nolatex" in msg
|
||||||
assert "installed" in msg
|
assert "installed" in msg
|
||||||
# check if we have latex installed, and abort test if we don't
|
# check if we have latex installed, and abort test if we don't
|
||||||
for cmd in ("latex", "dvipng"):
|
for cmd in ("latex", "dvipng"):
|
||||||
|
@ -26,7 +26,7 @@ def test_latex():
|
||||||
print "aborting test; %s is not installed" % cmd
|
print "aborting test; %s is not installed" % cmd
|
||||||
return
|
return
|
||||||
# fix path
|
# fix path
|
||||||
anki.latex.latexCmd[0] = "latex"
|
anki.latex.latexCmds[0][0] = "latex"
|
||||||
# check media db should cause latex to be generated
|
# check media db should cause latex to be generated
|
||||||
d.media.check()
|
d.media.check()
|
||||||
assert len(os.listdir(d.media.dir())) == 1
|
assert len(os.listdir(d.media.dir())) == 1
|
||||||
|
|
Loading…
Reference in a new issue