kitty/kitty_tests/utmp.py

18 lines
434 B
Python
Raw Normal View History

2021-10-05 09:11:18 +03:00
import subprocess
2021-10-05 09:11:34 +03:00
2021-10-05 09:11:18 +03:00
from kitty.fast_data_types import num_users
2021-10-05 09:11:34 +03:00
2021-10-05 09:11:18 +03:00
from . import BaseTest
2021-10-05 06:35:26 +03:00
2021-10-05 09:11:18 +03:00
class UTMPTest(BaseTest):
def test_num_users(self):
# who is the control
try:
expected = subprocess.check_output(['who']).decode('utf-8').count('\n')
except FileNotFoundError:
self.skipTest('No who executable cannot verify num_users')
2022-12-11 18:25:06 +03:00
else:
self.ae(num_users(), expected)