Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzedir command #95

Merged
merged 5 commits into from
Apr 6, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add simple unit test for analyzedir
  • Loading branch information
osma committed Apr 6, 2018
commit a0f72082025a16c44af2254a7bb632a923ce368d
13 changes: 13 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ def test_analyze_param():
assert result.exit_code == 0


def test_analyzedir(tmpdir):
tmpdir.join('doc1.txt').write('nothing special')

result = runner.invoke(
annif.cli.cli, ['analyzedir', 'dummy-en', str(tmpdir)])
assert not result.exception
assert result.exit_code == 0

assert tmpdir.join('doc1.annif').exists()
assert tmpdir.join('doc1.annif').read_text(
'utf-8') == "<http:https://example.org/dummy>\tdummy\t0.5\n"


def test_eval_label(tmpdir):
keyfile = tmpdir.join('dummy.key')
keyfile.write("dummy\nanother\n")
Expand Down