Skip to content

Commit

Permalink
Add unit test for training vw_multi using input from another project
Browse files Browse the repository at this point in the history
  • Loading branch information
osma committed Feb 5, 2019
1 parent f77c4a9 commit c4d5ea4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_backend_vw_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ def test_vw_multi_train(datadir, document_corpus, project):
assert datadir.join('vw-model').size() > 0


def test_vw_multi_train_from_project(app, datadir, document_corpus, project):
vw_type = annif.backend.get_backend('vw_multi')
vw = vw_type(
backend_id='vw_multi',
params={
'chunksize': 4,
'inputs': '_text_,dummy-en'},
datadir=str(datadir))

with app.app_context():
vw.train(document_corpus, project)
assert vw._model is not None
assert datadir.join('vw-model').exists()
assert datadir.join('vw-model').size() > 0


def test_vw_multi_train_multiple_passes(datadir, document_corpus, project):
vw_type = annif.backend.get_backend('vw_multi')
vw = vw_type(
Expand Down

0 comments on commit c4d5ea4

Please sign in to comment.