MCPcopy Create free account
hub / github.com/FastLED/FastLED / test_process_exists

Function test_process_exists

ci/docker_utils/test_container_db.py:117–133  ·  view source on GitHub ↗

Test process existence checking.

()

Source from the content-addressed store, hash-verified

115
116
117def test_process_exists():
118 """Test process existence checking."""
119 print("Testing process existence checking...")
120
121 # Current process should exist
122 current_pid = os.getpid()
123 assert process_exists(current_pid), "Current process not detected as alive"
124
125 # PID 1 should exist on Unix systems (init/systemd)
126 # On Windows, we'll skip this check
127 if os.name != "nt":
128 assert process_exists(1), "PID 1 not detected as alive"
129
130 # Very high PID should not exist
131 assert not process_exists(999999), "Non-existent PID incorrectly detected as alive"
132
133 print("✓ Process existence test passed")
134
135
136def main():

Callers 1

mainFunction · 0.85

Calls 2

process_existsFunction · 0.90
printFunction · 0.50

Tested by

no test coverage detected