31 lines
636 B
Python
31 lines
636 B
Python
from click.testing import CliRunner
|
|
|
|
from xexe.cli import get_rates
|
|
|
|
|
|
def test_get_rates_reads_input_correctly():
|
|
|
|
runner = CliRunner()
|
|
|
|
run_result = runner.invoke(
|
|
get_rates,
|
|
[
|
|
"--start-date",
|
|
"2024-01-01",
|
|
"--end-date",
|
|
"2024-01-02",
|
|
"--currencies",
|
|
"USD,GBP",
|
|
"--output",
|
|
"test_output.csv",
|
|
"--dry-run",
|
|
],
|
|
)
|
|
|
|
assert run_result.exit_code == 0
|
|
|
|
|
|
def test_get_rates_breaks_without_output():
|
|
runner = CliRunner()
|
|
result = runner.invoke(get_rates)
|
|
assert result.exit_code == 2
|