Skip to content

Commit

Permalink
ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
captivus committed Oct 10, 2023
1 parent 37c6c10 commit b0c287d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@
VENV_DIR = "./venv_test_installation"
venv.create(VENV_DIR, with_pip=True)


# Test that the package can be installed via pip
def test_installation():
# Use pip from the virtual environment directly
pip_executable = f"{VENV_DIR}/bin/pip"
if sys.platform == "win32":
pip_executable = f"{VENV_DIR}/Scripts/pip.exe"

result = subprocess.run(
[pip_executable, "install", "."],
capture_output=True
)

result = subprocess.run([pip_executable, "install", "."], capture_output=True)
assert result.returncode == 0, f"Install via pip failed: {result.stderr.decode()}"


# Test that the package can be imported
def test_import():
try:
Expand All @@ -36,15 +35,17 @@ def test_import():
except ImportError as e:
assert False, f"Failed to import {e.name}"


# Test that the CLI command works
def test_cli_execution():
# This assumes that after installation, `gpt-engineer` command should work.
result = subprocess.run(
args=["gpt-engineer", "--help"],
capture_output=True,
text=True
)
assert result.returncode == 0, f"gpt-engineer command failed with message: {result.stderr}"
args=["gpt-engineer", "--help"], capture_output=True, text=True
)
assert (
result.returncode == 0
), f"gpt-engineer command failed with message: {result.stderr}"


# Cleanup the test environment
def test_cleanup():
Expand Down

0 comments on commit b0c287d

Please sign in to comment.