Ejemplo n.º 1
0
def test_empty_file():
    with pytest.raises(Exception):
        with open('tests/inputs/empty_file.ttl') as f:
            rdf_handler = RDFHandler(f)
            shape = rdf_handler.get_shape_no_root_iri()
            generate_form(shape, form_destination='result.html')
            map_destination='result.ttl'
            rdf_handler.create_rdf_map(shape, map_destination)
Ejemplo n.º 2
0
def test_shape():
    # Contents of result can't be verified due to RDF and therefore the HTML result being unordered
    if os.path.exists('results'):
        shutil.rmtree('results')
    with open('tests/inputs/test_shape.ttl') as f:
        rdf_handler = RDFHandler(f)
        shape = rdf_handler.get_shape_no_root_iri()
        generate_form(shape, form_destination='results/result.html')
        map_destination='results/result.ttl'
        rdf_handler.create_rdf_map(shape, map_destination)
    assert os.path.exists('results/result.html')