diff --git a/e2e/binary/pwd/BUILD.bazel b/e2e/binary/pwd/BUILD.bazel index 5a1dce760ea1d1b6be60d754b454023816761328..6733c8c33fc5766ad43102f00e291b04a7e7660a 100644 --- a/e2e/binary/pwd/BUILD.bazel +++ b/e2e/binary/pwd/BUILD.bazel @@ -1,11 +1,31 @@ -load("@bazel_skylib//rules:build_test.bzl", "build_test") +load("@bazel_skylib//rules:native_binary.bzl", "native_test") +load("@rules_python_pytest//python_pytest:defs.bzl", "py_pytest_test") -# TODO: write an _actual_ test for `pwd` +py_pytest_test( + name = "pytest", + size = "small", + srcs = ["pwd.py"], + data = [ + "fixture.txt", + "@ape//ape:pwd", + ], + deps = [ + "//binary:pytest", + ], +) -build_test( - name = "pwd", +native_test( + name = "version", size = "small", - tags = ["stub"], - targets = ["@ape//ape:pwd"], + src = "@ape//ape:pwd", + args = ["--version"], +) + +test_suite( + name = "pwd", + tests = [ + "pytest", + "version", + ], visibility = ["//:__subpackages__"], ) diff --git a/e2e/binary/pwd/fixture.txt b/e2e/binary/pwd/fixture.txt new file mode 100644 index 0000000000000000000000000000000000000000..8e9681736d4dd84fabe385260eb76b85b0589eec --- /dev/null +++ b/e2e/binary/pwd/fixture.txt @@ -0,0 +1,2 @@ + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum placerat at risus a sagittis. Suspendisse potenti. Ut efficitur metus eu leo condimentum, sit amet efficitur mi tempus. Duis sit amet efficitur elit. Duis a ultrices massa. In hac habitasse platea dictumst. Integer vitae nibh tristique, tempus quam eget, sodales sem. diff --git a/e2e/binary/pwd/pwd.py b/e2e/binary/pwd/pwd.py new file mode 100644 index 0000000000000000000000000000000000000000..1b573c07b4be5949096444209421459daee1f94d --- /dev/null +++ b/e2e/binary/pwd/pwd.py @@ -0,0 +1,16 @@ +from __future__ import annotations + +from pathlib import Path +from subprocess import run + +from binary import Relative, Tool + + +def test_pwd(tool: Tool, relative: Relative, tmp_path: Path, diff: Diff) -> None: + binary = tool("pwd") + fixture = relative("fixture.txt") + + cmd = (binary, fixture) + result = run(cmd, check=True, timeout=30, text=True) + + assert result