示例#1
0
def test_get_owner(tmpdir):
    root_dir = os.path.join(tmpdir.strpath, "resource/")
    jrs = JsonResourceServer(root_dir, "info/", "https://example.com",
                             ["alice"])
    jrs.index["alice"] = 1
    assert jrs.get_owner("info/alice/1") == "alice"
    assert jrs.get_owner("info/public/x") is None
示例#2
0
def test_get_owner(tmpdir):
    root_dir = os.path.join(tmpdir.strpath, "resource/")
    jrs = JsonResourceServer(root_dir, "info/", "https://example.com",
                             ["alice"])
    jrs.index["alice"] = 1
    assert jrs.get_owner("info/alice/1") == "alice"
    assert jrs.get_owner("info/public/x") is None
示例#3
0
文件: test_jrs.py 项目: dv10den/pyuma
def test_get_owner():
    jrs = JsonResourceServer("resource/", "info/", "https://example.com",
                             ["alice"])
    jrs.index["alice"] = 1
    assert jrs.get_owner("info/alice/1") == "alice"
    assert jrs.get_owner("info/public/x") is None