generated from ajparsons/python-poetry-auto-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |