[psutil] r1265 committed - (OSX) add a test for total swap memory

0 views
Skip to first unread message

psu...@googlecode.com

unread,
Mar 5, 2012, 7:20:56 PM3/5/12
to psutil-...@googlegroups.com
Revision: 1265
Author: g.rodola
Date: Mon Mar 5 16:20:01 2012
Log: (OSX) add a test for total swap memory
http://code.google.com/p/psutil/source/detail?r=1265

Modified:
/trunk/test/_osx.py

=======================================
--- /trunk/test/_osx.py Wed Oct 5 11:45:49 2011
+++ /trunk/test/_osx.py Mon Mar 5 16:20:01 2012
@@ -12,6 +12,7 @@
import subprocess
import time
import sys
+import os

import psutil

@@ -45,6 +46,11 @@
sysctl_hwphymem = sysctl('sysctl hw.memsize')
self.assertEqual(sysctl_hwphymem, psutil.TOTAL_PHYMEM)

+ def test_total_virtmem(self):
+ tot1 = psutil.virtmem_usage().total
+ tot2 = os.path.getsize("/var/vm/swapfile0")
+ assertEqual(tot1, tot2)
+
def test_process_create_time(self):
cmdline = "ps -o lstart -p %s" %self.pid
p = subprocess.Popen(cmdline, shell=1, stdout=subprocess.PIPE)

Reply all
Reply to author
Forward
0 new messages