forked from CapivaraProjects/repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassifierRepository_test.py
More file actions
38 lines (33 loc) · 1.49 KB
/
ClassifierRepository_test.py
File metadata and controls
38 lines (33 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from ClassifierRepository import ClassifierRepository
import models.Classifier
import models.Plant
classifierRep = ClassifierRepository(
'capivara',
'test',
'127.0.0.1',
'5432',
'green_eyes')
def test_insert():
classifier = models.Classifier.Classifier(0,
models.Plant.Plant(1,'Malus domestica','Apple'),
'1',
'gykernel/saved_models')
assert classifierRep.create(classifier).path == 'gykernel/saved_models'
def test_search():
classifiers = classifierRep.search(classifier=models.Classifier.Classifier(path="gykernel/saved_models"))
print('return {0} lines'.format(len(classifiers)))
assert 'gykernel/saved_models' in classifiers['content'][0].path
def test_update():
classifier = models.Classifier.Classifier(0,
models.Plant.Plant(1,'Malus domestica','Apple'),
'2',
'gykernel/saved_models')
classifier = classifierRep.update(classifier)
assert classifier.tag == '2'
def test_delete():
classifier = models.Classifier.Classifier(0,
models.Plant.Plant(1,'Malus domestica','Apple'),
'2',
'gykernel/saved_models')
result = classifierRep.delete(classifier)
assert result is True