Esempio n. 1
0
def test_set_null_base():
    ctx = Context(base="http://example.org/app/data/item",
                  source={'@base': None})
    assert ctx.base is None
    assert ctx.resolve_iri("../other") == "../other"
Esempio n. 2
0
def test_set_null_base():
    ctx = Context(base="http://example.org/app/data/item",
            source={'@base': None})
    assert ctx.base is None
    assert ctx.resolve_iri("../other") == "../other"
Esempio n. 3
0
def test_resolve_relative_base():
    ctx = Context(base="http://example.org/app/data/item",
                  source={'@base': "../"})
    assert ctx.base == "http://example.org/app/"
    assert ctx.resolve_iri("../other") == "http://example.org/other"
Esempio n. 4
0
def test_resolve_relative_base():
    ctx = Context(base="http://example.org/app/data/item",
            source={'@base': "../"})
    assert ctx.base == "http://example.org/app/"
    assert ctx.resolve_iri("../other") == "http://example.org/other"