This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
from slic.utils.termtitle import *
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
@pytest.mark.skipif(not os.environ.get("WINDOWID"), reason="X11 actif terminal necessary")
|
||||
def test_termtitle_changes_actual_title():
|
||||
|
||||
# Generate title
|
||||
test_title = f"TEST_{time.time()}"
|
||||
|
||||
# Change terminal titre
|
||||
termtitle(test_title)
|
||||
time.sleep(0.5) #
|
||||
|
||||
# Capture actual terminal title with xprop
|
||||
result = subprocess.run(
|
||||
["xprop", "-id", os.environ["WINDOWID"],
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
captured_title = result.stdout.split("WM_NAME = ")[1].strip('"\n')
|
||||
|
||||
assert test_title in captured_title
|
||||
|
||||
Reference in New Issue
Block a user