示例#1
0
def test_disk_usage(flush):
    for mountpoint in ["/", "/etc/", "/home", "/var"]:
        pslib_usage = ffi.new("DiskUsage *")
        P.disk_usage(mountpoint, pslib_usage)
        psutil_usage = psutil.disk_usage(mountpoint)
        assert psutil_usage.total == pslib_usage.total
        assert psutil_usage.used == pslib_usage.used
        assert psutil_usage.free == pslib_usage.free
示例#2
0
def test_disk_usage(flush):
    for mountpoint in ["/", "/etc/", "/home", "/var"]:
        pslib_usage = ffi.new("DiskUsage *")
        P.disk_usage(mountpoint, pslib_usage)
        psutil_usage = psutil.disk_usage(mountpoint)
        assert psutil_usage.total == pslib_usage.total
        assert psutil_usage.used == pslib_usage.used
        assert psutil_usage.free == pslib_usage.free
示例#3
0
def test_swap(almost_equal, flush):
    pslib_swap = ffi.new("SwapMemInfo *")
    P.swap_memory(pslib_swap)
    psutil_vmem = psutil.swap_memory()

    assert almost_equal(pslib_swap.total, psutil_vmem.total)
    assert almost_equal(pslib_swap.used, psutil_vmem.used)
    assert almost_equal(pslib_swap.free, psutil_vmem.free)
    assert almost_equal(pslib_swap.percent, psutil_vmem.percent)
    assert almost_equal(pslib_swap.sin, psutil_vmem.sin)
    assert almost_equal(pslib_swap.sout, psutil_vmem.sout)
示例#4
0
def test_virtual_memory_darwin(almost_equal, flush):
    pslib_vmem = ffi.new("VmemInfo *")
    P.virtual_memory(pslib_vmem)
    psutil_vmem = psutil.virtual_memory()

    assert almost_equal(pslib_vmem.total, psutil_vmem.total)
    assert almost_equal(pslib_vmem.free, psutil_vmem.free)
    assert almost_equal(pslib_vmem.active, psutil_vmem.active)
    assert almost_equal(pslib_vmem.inactive, psutil_vmem.inactive)
    assert almost_equal(pslib_vmem.wired, psutil_vmem.wired)
    assert almost_equal(pslib_vmem.available, psutil_vmem.available)
    assert almost_equal(pslib_vmem.percent, psutil_vmem.percent)
    assert almost_equal(pslib_vmem.used, psutil_vmem.used)