Completed
Branch master (c130d7)
by Osma
03:05 queued 01:02
created

test_listSubjects()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
1
#!/usr/bin/env python3
2
3
import sys
4
import os
5
from elasticsearch import Elasticsearch
6
from elasticsearch.client import IndicesClient
7
from click.testing import CliRunner
8
sys.path.insert(1, os.path.join(sys.path[0], '..'))
9
from annif import annif
10
11
es = Elasticsearch()
12
index = IndicesClient(es)
13
runner = CliRunner()
14
15
16
# A dummy test for setup purposes
17
def test_start():
18
    assert annif.start() == "Started application"
19
20
21
def test_init():
22
    result = runner.invoke(annif.init)
23
    assert index.exists('annif')  # TODO: read index name from configuration
24
    assert result.exit_code == 0
25
26
27
def test_listprojects():
28
    # The listprojects function does not accept any arguments, it should fail
29
    # if such are provided.
30
    assert runner.invoke(annif.listprojects, ['moi']).exit_code != 0
31
    assert runner.invoke(
32
            annif.listprojects, ['moi', '--debug', 'y']).exit_code != 0
33
34
35
def test_showProject():
36
    pass
37
38
39
def test_createProject():
40
    pass
41
42
43
def test_dropProject():
44
    pass
45
46
47
def test_listSubjects():
48
    pass
49
50
51
def test_showSubject():
52
    pass
53
54
55
def createSubject():
56
    pass
57
58
59
def test_load():
60
    pass
61
62
63
def dropSubject():
64
    pass
65
66
67
def test_analyze():
68
    pass
69