quite a bit of development around get rates input handling
This commit is contained in:
parent
46988352ca
commit
4f81ac2e62
8 changed files with 199 additions and 20 deletions
37
tests/tests_cli/test_xe_get_rates.py
Normal file
37
tests/tests_cli/test_xe_get_rates.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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_works_with_defaults():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(get_rates, ["--output", "test_output.csv"])
|
||||
assert result.exit_code == 0
|
||||
|
||||
|
||||
def test_get_rates_breaks_without_output():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(get_rates)
|
||||
assert result.exit_code == 2
|
||||
Loading…
Add table
Add a link
Reference in a new issue