def testMemory(self):
        global logger
        res = Memory(logger).check({})
        if Platform.is_linux():
            MEM_METRICS = ["swapTotal", "swapFree", "swapPctFree", "swapUsed", "physTotal", "physFree", "physUsed", "physBuffers", "physCached", "physUsable", "physPctUsable", "physShared"]
            for k in MEM_METRICS:
                # % metric is only here if total > 0
                if k == 'swapPctFree' and res['swapTotal'] == 0:
                    continue
                assert k in res, res
            assert res["swapTotal"] == res["swapFree"] + res["swapUsed"]
            assert res["physTotal"] == res["physFree"] + res["physUsed"]
        elif sys.platform == 'darwin':
            for k in ("swapFree", "swapUsed", "physFree", "physUsed"):
                assert k in res, res
dataset/ETHPy150Open serverdensity/sd-agent/tests/checks/mock/test_sysstat.py/TestSystem.testMemory/original