File: test_init.py

package info (click to toggle)
python-psutil-home-assistant 0.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 116 kB
  • sloc: python: 45; makefile: 4
file content (11 lines) | stat: -rw-r--r-- 413 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import psutil
import psutil_home_assistant

def test_multiple_copies():
    """Test that multiple psutil instances can be created and do not interfere."""

    psutil1 = psutil_home_assistant.PsutilWrapper()
    psutil2 = psutil_home_assistant.PsutilWrapper()

    assert psutil._last_cpu_times is not psutil1.psutil._last_cpu_times
    assert psutil1.psutil._last_cpu_times is not psutil2.psutil._last_cpu_times