mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-11 18:32:12 +02:00
Fix utmp test
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
from sys import platform
|
||||
import subprocess
|
||||
from kitty.fast_data_types import num_users
|
||||
from . import BaseTest
|
||||
|
||||
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)
|
||||
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')
|
||||
self.ae(num_users(), expected)
|
||||
|
||||
Reference in New Issue
Block a user