I think I fixed the import and export clipboard manual buttons. They work for me for now at least.

This commit is contained in:
Storm Dragon
2026-08-17 03:25:57 -04:00
parent 68462d00cb
commit 45019091ab
2 changed files with 27 additions and 3 deletions
+19
View File
@@ -37,6 +37,25 @@ def test_write_text_uses_display_env_without_mutating_process_env(
assert os.environ.get("DISPLAY") is None
@pytest.mark.unit
def test_write_text_does_not_capture_daemonized_writer_pipes(monkeypatch):
monkeypatch.setattr(x_clipboard.shutil, "which", command_exists)
def run_command(command, **kwargs):
if (
kwargs["stdout"] == subprocess.PIPE
or kwargs["stderr"] == subprocess.PIPE
):
raise subprocess.TimeoutExpired(command, 2.0)
return subprocess.CompletedProcess(
command, 0, stdout=None, stderr=None
)
monkeypatch.setattr(x_clipboard.subprocess, "run", run_command)
assert x_clipboard.write_text("clipboard text", ":3") is True
@pytest.mark.unit
def test_read_text_scans_displays_until_text_is_found(monkeypatch):
monkeypatch.delenv("DISPLAY", raising=False)