Skip to content

Commit

Permalink
add typer cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Fiddy committed Dec 19, 2024
1 parent e5deaef commit 1bc1dd5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import subprocess
import sys
from unittest.mock import patch

from typer.testing import CliRunner

from bimorph_mirror_analysis import __version__
from bimorph_mirror_analysis.__main__ import app

runner = CliRunner()


def test_app():
with patch("bimorph_mirror_analysis.__main__.np.savetxt") as mock_np_save:
runner.invoke(app, ["calculate-voltages", "tests/data/raw_data.csv"])
mock_np_save.assert_called_once()
runner.invoke(app, ["calculate-voltages", "tests/data/raw_data.csv"])


def test_cli_version():
Expand Down

0 comments on commit 1bc1dd5

Please sign in to comment.