summaryrefslogtreecommitdiff
path: root/psutil/tests/test_windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'psutil/tests/test_windows.py')
-rwxr-xr-xpsutil/tests/test_windows.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py
index cb2642d1..478e9010 100755
--- a/psutil/tests/test_windows.py
+++ b/psutil/tests/test_windows.py
@@ -162,6 +162,11 @@ class TestSystemAPIs(WindowsTestCase):
int(w.AvailableBytes), psutil.virtual_memory().free,
delta=TOLERANCE_SYS_MEM)
+ def test_percent_swapmem(self):
+ w = wmi.WMI().Win32_PerfRawData_PerfOS_PagingFile()[0]
+ percent = int(w.PercentUsage) * 100 / int(w.PercentUsage_Base)
+ self.assertEqual(int(percent), int(psutil.swap_memory().percent))
+
# @unittest.skipIf(wmi is None, "wmi module is not installed")
# def test__UPTIME(self):
# # _UPTIME constant is not public but it is used internally