Skip to content

Commit

Permalink
fix: remove legacy unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Mar 15, 2023
1 parent cf1e8db commit 6f3e5e2
Showing 1 changed file with 1 addition and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,42 +1,11 @@
import pytest

from robotoff.prediction.category.neural.category_classifier import (
CategoryClassifier,
CategoryPrediction,
)
from robotoff.prediction.types import Prediction
from robotoff.prediction.category.neural.category_classifier import CategoryClassifier
from robotoff.taxonomy import Taxonomy
from robotoff.types import InsightType

MODEL_VERSION = "category-classifier"


def test_category_prediction_to_prediction():
category_prediction = CategoryPrediction("category", 0.5, MODEL_VERSION)

assert category_prediction.to_prediction() == Prediction(
type=InsightType.category,
value_tag="category",
data={"model_version": MODEL_VERSION},
automatic_processing=False,
predictor="neural",
confidence=0.5,
)


def test_category_prediction_to_prediction_auto():
category_prediction = CategoryPrediction("category", 0.9, MODEL_VERSION)

assert category_prediction.to_prediction() == Prediction(
type=InsightType.category,
value_tag="category",
data={"model_version": MODEL_VERSION},
automatic_processing=False,
predictor="neural",
confidence=0.9,
)


class MockResponse:
def __init__(self, prediction: dict):
self.prediction = prediction
Expand Down

0 comments on commit 6f3e5e2

Please sign in to comment.