Beispiel #1
0
def test_freebsd_human_names():
    st_freebsd_dict = st_human_dict.copy()
    st_freebsd_dict["generation"] = 0
    st_freebsd_dict["creation_time"] = OrderedDict([
        ("seconds", 1535380109.4635055),
        ("iso8601", "2018-08-27T10:28:29.463506-04:00"),
    ])
    assert stat2dict(st_freebsd, human_names=True) == st_freebsd_dict
Beispiel #2
0
def test_freebsd():
    st_freebsd_dict = st_dict.copy()
    st_freebsd_dict["st_gen"] = 0
    st_freebsd_dict["st_birthtime"] = OrderedDict([
        ("seconds", 1535380109.4635055),
        ("iso8601", "2018-08-27T10:28:29.463506-04:00"),
    ])
    assert stat2dict(st_freebsd) == st_freebsd_dict
Beispiel #3
0
def test_linux_human_names():
    st_linux_dict = st_human_dict.copy()
    st_linux_dict["blocks"] = 16
    st_linux_dict["block_size"] = 4096
    st_linux_dict["rdev"] = OrderedDict([
        ("device_id", 0),
        ("major_id", 0),
        ("minor_id", 0),
    ])
    st_linux_dict["flags"] = OrderedDict([
        (k, False)
        for k in 'UF_NODUMP UF_IMMUTABLE UF_APPEND UF_OPAQUE UF_NOUNLINK'
        ' UF_COMPRESSED UF_HIDDEN SF_ARCHIVED SF_IMMUTABLE'
        ' SF_APPEND SF_NOUNLINK SF_SNAPSHOT'.split()
    ])
    assert stat2dict(st_linux, human_names=True) == st_linux_dict
Beispiel #4
0
def test_human_names():
    assert stat2dict(st, human_names=True) == st_human_dict
Beispiel #5
0
def test_basic():
    assert stat2dict(st) == st_dict