-
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.
Merge pull request #6 from AndrewADev/feat/csv-output
- Loading branch information
Showing
4 changed files
with
41 additions
and
12 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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from extract_list import output_list | ||
from extract_list import generate_list | ||
|
||
|
||
if __name__ == '__main__': | ||
output_list() | ||
generate_list() |
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
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 |
---|---|---|
@@ -1,14 +1,21 @@ | ||
from click.testing import CliRunner | ||
from gen_list.extract_list import output_list | ||
from gen_list.extract_list import generate_list | ||
|
||
# Needs to be relative to project root! | ||
test_data_path = './tests/data/karl-das-krokodil.txt' | ||
|
||
def test_has_expected_tokens(): | ||
runner = CliRunner() | ||
result = runner.invoke(output_list, ['--input', test_data_path]) | ||
result = runner.invoke(generate_list, ['--input', test_data_path]) | ||
assert result.exit_code == 0 | ||
assert "beschloss" in result.output | ||
assert "Haus" in result.output | ||
assert "Anpassungsfähigkeit" in result.output | ||
|
||
def test_exports_to_csv(): | ||
runner = CliRunner() | ||
result = runner.invoke(generate_list, args=['--input', test_data_path, '--output-type', 'csv']) | ||
assert result.exit_code == 0 | ||
assert "Token" in result.output # header | ||
assert "Haus" in result.output | ||
assert "Anpassungsfähigkeit" in result.output |