psutil.tests.test_windows

Windows specific tests.

Module Contents

cext
IS_64_BIT
wrap_exceptions(fun)
class TestCpuAPIs

Bases:psutil.tests.unittest.TestCase

test_cpu_count_vs_NUMBER_OF_PROCESSORS(self)
test_cpu_count_vs_GetSystemInfo(self)
test_cpu_count_logical_vs_wmi(self)
test_cpu_count_phys_vs_wmi(self)
test_cpu_count_vs_cpu_times(self)
test_cpu_freq(self)
class TestSystemAPIs

Bases:psutil.tests.unittest.TestCase

test_nic_names(self)
test_total_phymem(self)
test_pids(self)
test_disks(self)
test_disk_usage(self)
test_disk_partitions(self)
test_net_if_stats(self)
test_boot_time(self)
test_boot_time_fluctuation(self)
class TestSensorsBattery

Bases:psutil.tests.unittest.TestCase

test_has_battery(self)
test_percent(self)
test_power_plugged(self)
test_emulate_no_battery(self)
test_emulate_power_connected(self)
test_emulate_power_charging(self)
test_emulate_secs_left_unknown(self)
class TestProcess

Bases:psutil.tests.unittest.TestCase

classmethod setUpClass(cls)
classmethod tearDownClass(cls)
test_issue_24(self)
test_special_pid(self)
test_send_signal(self)
test_exe(self)
test_num_handles_increment(self)
test_handles_leak(self)
test_name_always_available(self)
test_ctrl_signals(self)
test_compare_name_exe(self)
test_username(self)
test_cmdline(self)
test_nice(self)
test_memory_info(self)
test_wait(self)
test_cpu_affinity(self)
test_io_counters(self)
test_num_handles(self)
class TestProcessWMI

Bases:psutil.tests.unittest.TestCase

Compare Process API results with WMI.

classmethod setUpClass(cls)
classmethod tearDownClass(cls)
test_name(self)
test_exe(self)
test_cmdline(self)
test_username(self)
test_memory_rss(self)
test_memory_vms(self)
test_create_time(self)
class TestDualProcessImplementation

Bases:psutil.tests.unittest.TestCase

Certain APIs on Windows have 2 internal implementations, one based on documented Windows APIs, another one based NtQuerySystemInformation() which gets called as fallback in case the first fails because of limited permission error. Here we test that the two methods return the exact same value, see: https://github.com/giampaolo/psutil/issues/304

classmethod setUpClass(cls)
classmethod tearDownClass(cls)
test_name(self)
test_memory_info(self)
test_create_time(self)
test_cpu_times(self)
test_io_counters(self)
test_num_handles(self)
test_cmdline(self)
class RemoteProcessTestCase

Bases:psutil.tests.unittest.TestCase

Certain functions require calling ReadProcessMemory. This trivially works when called on the current process. Check that this works on other processes, especially when they have a different bitness.

test_args = ['-c', 'import sys; sys.stdin.read()']
static find_other_interpreter()
classmethod setUpClass(cls)
setUp(self)
tearDown(self)
classmethod tearDownClass(cls)
test_cmdline_32(self)
test_cmdline_64(self)
test_cwd_32(self)
test_cwd_64(self)
test_environ_32(self)
test_environ_64(self)
class TestServices

Bases:psutil.tests.unittest.TestCase

test_win_service_iter(self)
test_win_service_get(self)