26 lines
760 B
Python
26 lines
760 B
Python
"""Step definitions for complete main module coverage tests."""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
from behave import then, when
|
|
|
|
|
|
@when("I run the __main__ module as a script with --version")
|
|
def step_run_main_as_script(context):
|
|
"""Run the __main__ module as a script."""
|
|
result = subprocess.run(
|
|
[sys.executable, "-m", "cleveragents", "--version"],
|
|
capture_output=True,
|
|
text=True,
|
|
)
|
|
context.result = result
|
|
context.exit_code = result.returncode
|
|
context.output = result.stdout + result.stderr
|
|
|
|
|
|
@then("the version should be displayed")
|
|
def step_check_version_displayed(context):
|
|
"""Check that the version is displayed."""
|
|
assert "CleverAgents" in context.output or "cleveragents" in context.output.lower()
|