Skip to content

Commit

Permalink
Add cli tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Aug 27, 2024
1 parent a48d9d4 commit 191dbb3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from mysoc_validator.__main__ import app
from typer.testing import CliRunner

runner = CliRunner()


def test_validate_popolo():
result = runner.invoke(
app,
[
"validate",
"--url",
"https://raw.githubusercontent.com/mysociety/parlparse/master/members/people.json",
"--type",
"popolo",
],
)
assert result.exit_code == 0
assert "Valid Popolo file" in result.stdout


def test_validate_transcript():
result = runner.invoke(
app,
["validate", "--file", "data/debates2023-03-28d.xml", "--type", "transcript"],
)
assert result.exit_code == 0
assert "Valid Transcript file" in result.stdout


def test_validate_interests():
result = runner.invoke(
app, ["validate", "--file", "data/regmem2024-05-28.xml", "--type", "interests"]
)
assert result.exit_code == 0
assert "Valid Interests file" in result.stdout

0 comments on commit 191dbb3

Please sign in to comment.