Skip to content

Commit

Permalink
write good test for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
gireg.roussel committed Aug 19, 2024
1 parent e556558 commit ccd97d1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_append.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,20 @@ def test_pass_wrong_dict_to_metrics_sould_raise():
# Then
assert len(excinfo.value.errors()) == excepted_number_errors == actual_number_errors
assert excepted_error_msg == actual_error_msg


def test_pass_good_dict_to_metrics_sould_create_YarrowDataset():
# Given
excepted_object = YarrowDataset_pydantic
excepted_metrics = {"iou": 0.99}

# When
actual_yar_dataset = YarrowDataset_pydantic(
images=[],
info=Info(source="common_flow", date_created="2021-01-01"),
metrics=excepted_metrics,
)

# Then
assert type(actual_yar_dataset) == excepted_object
assert actual_yar_dataset.metrics == excepted_metrics

0 comments on commit ccd97d1

Please sign in to comment.