Skip to content

Commit f29000b

Browse files
author
skepppy
committed
Add test case for "ls -l" on a file
1 parent fc59135 commit f29000b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/tools/test_shell.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,19 @@ def test_redirect_simple_ls(tmp_path: Path, target_win: Target, monkeypatch: pyt
257257
assert "sysvol" in content
258258

259259

260+
def test_target_cli_ls_file(capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch) -> None:
261+
# disable colorful output in `target-shell`
262+
monkeypatch.setattr(fs, "LS_COLORS", {})
263+
264+
out, _ = run_target_shell(
265+
monkeypatch,
266+
capsys,
267+
str(absolute_path("_data/filesystems/squashfs/gzip.sqfs")),
268+
"ls -l small-file",
269+
)
270+
assert "1000 1000 9 2022-12-05T18:53:05.000000+00:00" in out
271+
272+
260273
@pytest.mark.skipif(platform.system() == "Windows", reason="Unix-specific test")
261274
def test_redirect_pipe(tmp_path: Path, target_win: Target, monkeypatch: pytest.MonkeyPatch) -> None:
262275
monkeypatch.setattr(fs, "LS_COLORS", {"di": "\033[34m", "fi": "\033[0m"})

0 commit comments

Comments
 (0)