File size: 548 Bytes
0626826
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7e709ed
0626826
 
f4e0e4a
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
import pytest
from classification.classifier import Classifier

@pytest.fixture
def setup_pipeline():
    pipeline = Classifier()
    pipeline.train_and_save()
    return pipeline

@pytest.fixture
def requests():
    return {
        "features": [
            [6.5, 3.0, 5.8, 2.2],
            [6.1, 2.8, 4.7, 1.2]
        ]
    }

@pytest.fixture
def response():
    return ["virginica", "versicolor"]

def test_response(setup_pipeline, requests, response):
    assert response == setup_pipeline.load_and_test(requests["features"])["predictions"]