File: test_valid_svg.py

package info (click to toggle)
manimpango 0.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,804 kB
  • sloc: python: 1,252; sh: 164; makefile: 18
file content (16 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*- coding: utf-8 -*-
from pathlib import Path
from xml.parsers.expat import ParserCreate

from ._manim import Text


def test_whether_valid_svg_file(tmpdir):
    loc = Path(tmpdir, "test.svg")
    assert not loc.exists()
    Text("{ }", color="red", filename=str(loc))
    assert loc.exists()
    # verify that it's a valid svg file by parsing it
    with open(loc, "rb") as f:
        p = ParserCreate()
        p.ParseFile(f)