Skip to content

Commit

Permalink
Format code with black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] authored Dec 8, 2022
1 parent 838f9e1 commit d914ae2
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions tests/unit/insights/test_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,15 +504,12 @@ def test_generate_insights_no_predictions(self, mocker):
get_existing_insight_mock = mocker.patch(
"robotoff.insights.importer.get_existing_insight", return_value=[]
)
assert (
CategoryImporter.generate_insights(
DEFAULT_BARCODE,
[],
DEFAULT_SERVER_DOMAIN,
product_store=FakeProductStore(),
)
== ([], [], [])
)
assert CategoryImporter.generate_insights(
DEFAULT_BARCODE,
[],
DEFAULT_SERVER_DOMAIN,
product_store=FakeProductStore(),
) == ([], [], [])
get_existing_insight_mock.assert_called_once()

def test_generate_insights_no_predictions_with_existing_insight(self, mocker):
Expand All @@ -525,36 +522,30 @@ def test_generate_insights_no_predictions_with_existing_insight(self, mocker):
"robotoff.insights.importer.get_existing_insight",
return_value=[existing_insight],
)
assert (
CategoryImporter.generate_insights(
DEFAULT_BARCODE,
[],
DEFAULT_SERVER_DOMAIN,
product_store=FakeProductStore(),
)
== ([], [], [existing_insight])
)
assert CategoryImporter.generate_insights(
DEFAULT_BARCODE,
[],
DEFAULT_SERVER_DOMAIN,
product_store=FakeProductStore(),
) == ([], [], [existing_insight])
get_existing_insight_mock.assert_called_once()

def test_generate_insights_missing_product_no_references(self, mocker):
get_existing_insight_mock = mocker.patch(
"robotoff.insights.importer.get_existing_insight", return_value=[]
)
assert (
InsightImporter.generate_insights(
DEFAULT_BARCODE,
[
Prediction(
type=PredictionType.category,
barcode=DEFAULT_BARCODE,
data={},
)
],
DEFAULT_SERVER_DOMAIN,
product_store=FakeProductStore(),
)
== ([], [], [])
)
assert InsightImporter.generate_insights(
DEFAULT_BARCODE,
[
Prediction(
type=PredictionType.category,
barcode=DEFAULT_BARCODE,
data={},
)
],
DEFAULT_SERVER_DOMAIN,
product_store=FakeProductStore(),
) == ([], [], [])
get_existing_insight_mock.assert_called_once()

def test_generate_insights_missing_product_with_reference(self, mocker):
Expand Down

0 comments on commit d914ae2

Please sign in to comment.