utmp.py 434 B

123456789101112131415161718
  1. import subprocess
  2. from kitty.fast_data_types import num_users
  3. from . import BaseTest
  4. class UTMPTest(BaseTest):
  5. def test_num_users(self):
  6. # who is the control
  7. try:
  8. expected = subprocess.check_output(['who']).decode('utf-8').count('\n')
  9. except FileNotFoundError:
  10. self.skipTest('No who executable cannot verify num_users')
  11. else:
  12. self.ae(num_users(), expected)