Add tests for UTMP methods
This commit is contained in:
parent
072e583835
commit
1d4a86594b
13
kitty_tests/utmp.py
Normal file
13
kitty_tests/utmp.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from sys import platform
|
||||||
|
|
||||||
|
if platform in ('linux', 'linux2'):
|
||||||
|
import subprocess
|
||||||
|
import re
|
||||||
|
from kitty.fast_data_types import num_users
|
||||||
|
from . import BaseTest
|
||||||
|
|
||||||
|
class UTMPTest(BaseTest):
|
||||||
|
def test_num_users(self):
|
||||||
|
# who -q is the control
|
||||||
|
expected = subprocess.run(['who'], capture_output=True).stdout.decode('utf-8').count('\n')
|
||||||
|
self.ae(num_users(), expected)
|
||||||
Loading…
x
Reference in New Issue
Block a user