Skip to content

Commit

Permalink
test: add popen_reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Oct 19, 2024
1 parent b86568b commit 4a15082
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BUILD_DIR="$SCRIPT_DIR/build"

help() {
echo "Usage: $0 <PACKAGE_VERSION_NUM> <PLATFORM_NAME>"
echo "Usage: $0 4.14.0.2 manhlinux_2_17_x86_64.manylinux2014_x86_64"
}

if [[ $# -lt 2 ]]; then
Expand Down
17 changes: 10 additions & 7 deletions tests/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import re

from reduce_binary import REDUCE_BIN_PATH, run_reduce
from reduce_binary import REDUCE_BIN_PATH, popen_reduce, run_reduce


def test_exists():
Expand All @@ -17,20 +17,23 @@ def test_execute_help():
proc = run_reduce("-h")
assert proc.returncode == 2

proc = popen_reduce("-h")
proc.wait()
assert proc.returncode == 2


def test_execute_noarg():
proc = run_reduce("")
assert proc.returncode == 2

proc = popen_reduce("")
proc.wait()
assert proc.returncode == 2


def test_execute_noarg_message():
proc = run_reduce("", capture_output=True, text=True, encoding="utf-8")
print(proc)
if isinstance(proc.stderr, bytes):
lines = proc.stderr.decode("utf-8")
else:
lines = proc.stderr
first_line = lines.splitlines()[0]
first_line = proc.stdout.splitlines()[0]
assert (
re.match(
r"^reduce: version .*, Copyright .* J. Michael Word;.*Richardson Lab at Duke University$",
Expand Down

0 comments on commit 4a15082

Please sign in to comment.