コード例 #1
0
def test_httpurl_get_metadata(url_v6_txt, v6_txt_size, v6_txt_md5_hash):
    u = HTTPURL(url_v6_txt)

    m1 = u.get_metadata()
    assert m1.md5 == v6_txt_md5_hash
    assert m1.size == v6_txt_size

    m2 = u.get_metadata(skip_md5=True)
    assert m2.md5 is None
    assert m2.size == v6_txt_size

    u_md5 = HTTPURL(url_v6_txt + ".md5")
    if u_md5.exists:
        u_md5.rm()
    m3 = u.get_metadata(make_md5_file=True)
    assert m3.md5 == v6_txt_md5_hash
    assert m3.size == v6_txt_size
    # HTTPURL should not make md5 file even with make_md5_file=True
    assert not u_md5.exists
コード例 #2
0
def test_httpurl_rm(url_test_path):
    u = HTTPURL(url_test_path + "/test_httpurl_rm.tmp")
    with pytest.raises(ReadOnlyStorageError):
        u.rm()