Page MenuHomec4science

test_checker_handler.py
No OneTemporary

File Metadata

Created
Sat, Nov 9, 06:03

test_checker_handler.py

import lxml.etree as ET
from os import sep, path, remove
from os.path import isdir, isfile, dirname, basename
import shutil
import sys
import tempfile
import unittest
import warnings
from checker_handler import CheckerHandler
sys.path.append('svgscripts')
from datatypes.page import Page
class TestCheckerHandler(unittest.TestCase):
def setUp(self):
DATADIR = path.dirname(__file__) + sep + 'test_data'
self.fix_boxes = DATADIR + sep + 'Mp_XIV_page416.xml'
def test_check_get_set(self):
page = Page(self.fix_boxes)
checker = CheckerHandler(page)
checker.set_task_done(CheckerHandler.CHECKS[0])
self.assertTrue(len(checker.get_todos()) < len(CheckerHandler.CHECKS))
print(ET.dump(page.page_tree.xpath(f'//metadata/{CheckerHandler.XML_TAG}')[0]))
if __name__ == "__main__":
unittest.main()

Event Timeline