Render <latex> LaTeX elements using l2p command, and embed as images (used in epub)
[librarian.git] / tests / test_latex.py
diff --git a/tests/test_latex.py b/tests/test_latex.py
new file mode 100644 (file)
index 0000000..22db615
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+#
+# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+
+from nose.tools import *
+from librarian.latex import LatexFragment
+import os
+
+def test_latex_to_png():
+    lf = LatexFragment("$ \sum_{i = 0}^{123} n_i^{3}$")
+    name1 = lf.filename
+    assert_equal(name1.find("/"), -1)
+    name = lf.path
+    assert_true(os.path.exists(name))
+    print os.stat(name)
+    assert_true(os.stat(name).st_size > 0)
+    lf.remove()