Пример #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"
Пример #2
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"