Page MenuHomec4science

test_py2ttl_data.py
No OneTemporary

File Metadata

Created
Sat, May 18, 10:13

test_py2ttl_data.py

import unittest
import lxml.etree as ET
from os import sep, path, remove
from os.path import isfile, dirname
from rdflib import Graph, URIRef, Literal
import sys
sys.path.append('py2ttl')
import py2ttl_data
from py2ttl_data import Py2TTLDataConverter
from config import PROJECT_NAME, PROJECT_ONTOLOGY_FILE
from knora_base import KNORA_BASE
if dirname(dirname(__file__)) not in sys.path:
sys.path.append(dirname(dirname(__file__)))
from svgscripts.datatypes.word import Word
from svgscripts.datatypes.word_position import WordPosition
class TestPy2TTL(unittest.TestCase):
"""This is the unittest for py2ttl.py2ttl.
@label unittest
"""
def setUp(self):
DATADIR = dirname(__file__) + sep + 'test_data'
self.manuscript_file = DATADIR + sep + 'N_VII_1.xml'
self.ttl_target = __file__ + 'test.ttl'
def test_main(self):
Py2TTLDataConverter.UNITTESTING = True
argv = [ self.manuscript_file ]
self.assertEqual(py2ttl_data.main(argv), 0)
def tearDown(self):
isfile(self.ttl_target) and remove(self.ttl_target)
if __name__ == "__main__":
unittest.main()

Event Timeline