Skip to content

Commit

Permalink
Fixed test_cli.py and removed 'skipped'
Browse files Browse the repository at this point in the history
  • Loading branch information
eisDNV committed Nov 8, 2024
1 parent ffeb731 commit 34d5551
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,23 @@

def check_command(cmd: str, expected: str | None = None):
ret = subprocess.check_output(
"python ..\\..\\..\\" + cmd, shell=True, text=True
cmd, shell=True, text=True
).strip()
if expected is None:
print("OUTPUT:", ret)
else:
assert ret.startswith(expected), f"{cmd}: {ret} != {expected}"


@pytest.mark.skip("This tests need to be updated")
def test_cli():
os.chdir(str(Path(__file__).parent / "data" / "BouncingBall3D"))
check_command("sim-explorer -V", "0.1.0")
check_command(
"sim-explorer BouncingBall3D.cases --info",
"ARGS Namespace(cases='BouncingBall3D.cases'",
"Cases BouncingBall3D. Simple sim explorer with the 3D BouncingBall FMU (3D position and",
)
expected = "ARGS Namespace(cases='BouncingBall3D.cases', info=False, run='restitution', Run=None)"
check_command("sim-explorer BouncingBall3D.cases --run restitution", expected)
check_command("sim-explorer BouncingBall3D.cases --Run base")
check_command("sim-explorer BouncingBall3D.cases --run restitution", "")
check_command("sim-explorer BouncingBall3D.cases --Run base", "")


if __name__ == "__main__":
Expand Down

0 comments on commit 34d5551

Please sign in to comment.