예제 #1
0
def test_namespacing():
    """Tests that the RDF parser successfully creates namespaces."""
    
    r = RDFParser(_load_rdf("tests/resources/rdf/pass.rdf"), "foo")
    
    assert r.namespace == "foo"
    assert str(r.uri("bar")) == "foo#bar"
    assert str(r.uri("bar", "abc")) == "abc#bar"
예제 #2
0
def test_namespacing():
    """Tests that the RDF parser successfully creates namespaces."""

    r = RDFParser(None, open('tests/resources/rdf/pass.rdf'), 'foo')

    assert r.namespace == 'foo'
    assert str(r.uri('bar')) == 'foo#bar'
    assert str(r.uri('bar', 'abc')) == 'abc#bar'
예제 #3
0
def test_namespacing():
    """Tests that the RDF parser successfully creates namespaces."""

    r = RDFParser(None, open('tests/resources/rdf/pass.rdf'), 'foo')

    assert r.namespace == 'foo'
    assert str(r.uri('bar')) == 'foo#bar'
    assert str(r.uri('bar', 'abc')) == 'abc#bar'
예제 #4
0
def test_namespacing():
    """Tests that the RDF parser successfully creates namespaces."""

    r = RDFParser(None, open("tests/resources/rdf/pass.rdf"), "foo")

    assert r.namespace == "foo"
    assert str(r.uri("bar")) == "foo#bar"
    assert str(r.uri("bar", "abc")) == "abc#bar"
예제 #5
0
def test_get_root_subject():
    'Tests the integrity of the get_root_subject() function'

    r = RDFParser(None, open('tests/resources/rdf/pass.rdf'))
    type_uri = r.uri('type')

    emtype = r.get_object(None, type_uri)
    assert emtype is not None

    emtype = r.get_object(r.get_root_subject(), type_uri)
    assert emtype is not None
예제 #6
0
def test_get_root_subject():
    "Tests the integrity of the get_root_subject() function"
    
    r = RDFParser(_load_rdf("tests/resources/rdf/pass.rdf"))
    type_uri = r.uri("type")
    
    emtype = r.get_object(None, type_uri)
    assert emtype is not None
    
    emtype = r.get_object(r.get_root_subject(), type_uri)
    assert emtype is not None
예제 #7
0
def test_get_root_subject():
    'Tests the integrity of the get_root_subject() function'

    r = RDFParser(None, open('tests/resources/rdf/pass.rdf'))
    type_uri = r.uri('type')

    emtype = r.get_object(None, type_uri)
    assert emtype is not None

    emtype = r.get_object(r.get_root_subject(), type_uri)
    assert emtype is not None
예제 #8
0
def test_get_object():
    """Tests the integrity of the get_object() and get_objects()
    functions."""

    r = RDFParser(None, open('tests/resources/rdf/pass.rdf'))
    test_uri = r.uri('test')

    emtest = r.get_object(None, test_uri)
    assert emtest is not None

    emtests = r.get_objects(None, test_uri)
    assert len(emtests) == 3
    assert emtests[0] == emtest
예제 #9
0
def test_get_object():
    """"Tests the integrity of the get_object() and get_objects()
    functions."""
    
    r = RDFParser(_load_rdf("tests/resources/rdf/pass.rdf"))
    test_uri = r.uri("test")
    
    emtest = r.get_object(None, test_uri)
    assert emtest is not None
    
    emtests = r.get_objects(None, test_uri)
    assert len(emtests) == 3
    assert emtests[0] == emtest