diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2021-12-31 00:42:24 +0100 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2021-12-31 00:42:24 +0100 |
| commit | 6cccc6aa93cf1e05b6946a9a96261b77dbdb7e5a (patch) | |
| tree | e8a5c48d2d64c71628b8a120354f85007514c599 /psutil/tests/test_linux.py | |
| parent | 05638fdf194d8942fb40d17b919d89a67fcfcbc1 (diff) | |
| download | psutil-6cccc6aa93cf1e05b6946a9a96261b77dbdb7e5a.tar.gz | |
split logic in 2 funs
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
Diffstat (limited to 'psutil/tests/test_linux.py')
| -rwxr-xr-x | psutil/tests/test_linux.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index 91f2ab3d..34856f0f 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -2381,7 +2381,7 @@ class TestVirtualizationVms(PsutilTestCase): self.assertEqual(self.detector.ask_proc_devtree_hypervisor(), "vm-other") - def test_ask_proc_devtree(self): + def test_detect_powervm(self): def exists(path): if path in ("/proc/device-tree/ibm,partition-name", "/proc/device-tree/hmc-managed?"): @@ -2391,11 +2391,11 @@ class TestVirtualizationVms(PsutilTestCase): orig_fun = os.path.exists with mock.patch("os.path.exists", create=True, side_effect=exists): - self.assertEqual(self.detector.ask_proc_devtree(), "powervm") + self.assertEqual(self.detector.detect_powervm(), "powervm") - # check for qemu + def test_detect_qemu(self): with mock.patch("os.listdir", return_value=["fw-cfg"]): - self.assertEqual(self.detector.ask_proc_devtree(), "qemu") + self.assertEqual(self.detector.detect_qemu(), "qemu") def test_ask_proc_sysinfo(self): with mock_open_content( |
