edge_orchestrator CI on branch >> 61/merge << #368
54 passed, 13 failed and 0 skipped
❌ edge_orchestrator/reports/pytest/unit-tests-report.xml
67 tests were completed in 3s with 54 passed, 13 failed and 0 skipped.
Test suite | Passed | Failed | Skipped | Time |
---|---|---|---|---|
pytest | 54✅ | 13❌ | 3s |
❌ pytest
tests.unit_tests.domain.test_supervisor.TestSupervisor
✅ test_2_models_in_parallel
✅ test_2_models_in_serie
✅ test_get_prediction_for_camera_should_return_2_predicted_objects_by_one_object_detection_model[camera_id1]
✅ test_get_prediction_for_camera_should_return_2_predicted_objects_by_one_object_detection_model[camera_id2]
✅ test_get_prediction_for_camera_should_return_2_predicted_objects_by_one_object_detection_model[camera_id3]
✅ test_get_prediction_for_camera_should_return_2_predicted_objects_by_one_object_detection_model[camera_id4]
✅ test_get_prediction_for_camera_should_return_1_predicted_object_by_one_classification_model[camera_id1]
✅ test_get_prediction_for_camera_should_return_1_predicted_object_by_one_classification_model[camera_id2]
✅ test_get_prediction_for_camera_should_return_1_predicted_object_by_one_classification_model[camera_id3]
✅ test_get_prediction_for_camera_should_return_1_predicted_object_by_one_classification_model[camera_id4]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_followed_by_classif[camera_id1]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_followed_by_classif[camera_id2]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_followed_by_classif[camera_id3]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_followed_by_classif[camera_id4]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_with_classif_model[camera_id1]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_with_classif_model[camera_id2]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_with_classif_model[camera_id3]
✅ test_get_prediction_for_camera_returns_2_objects_with_label_for_object_detection_with_classif_model[camera_id4]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_1_is_classification[camera_id1]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_1_is_classification[camera_id2]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_1_is_classification[camera_id3]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_1_is_classification[camera_id4]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_2_are_classification[camera_id1]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_2_are_classification[camera_id2]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_2_are_classification[camera_id3]
✅ test_get_prediction_for_camera_should_return_1_output_by_model_and_among_them_2_are_classification[camera_id4]
✅ test_apply_crop_function_with_correct_box_should_resize_the_picture
✅ test_apply_crop_function_with_incorrect_box_should_log_an_error_and_return_the_same_picture
❌ test_set_decision_should_send_final_decision_to_telemetry_sink
self = <test_supervisor.TestSupervisor object at 0x7f075193a2e0>
❌ test_inspect_should_log_information_about_item_processing
self = <test_supervisor.TestSupervisor object at 0x7f075193a3d0>
tests.unit_tests.domain.models.test_edge_station.TestEdgeStation
❌ test_register_cameras_raises_exception_when_no_active_configuration_is_set
self = <test_edge_station.TestEdgeStation object at 0x7f075193aa60>
✅ test_capture_should_raise_exception_when_cameras_are_not_registered
✅ test_capture_should_instantiate_item_with_1_binary
tests.unit_tests.domain.models.test_item.TestItem
✅ test_item_from_nothing_should_instantiate_empty_item_with_serial_number_and_category_hardcoded
tests.unit_tests.domain.models.business_rule.test_camera_business_rules.TestCameraBusinessRule
✅ test_camera_decision_should_return_KO_when_expected_label_is_OK
✅ test_camera_decision_should_return_OK_when_minimum_one_person_is_detected
✅ test_camera_decision_should_return_OK_when_minimum_one_face_is_detected_with_two_object_detection_models
✅ test_camera_decision_should_return_OK_when_minimum_one_connected_cellphone_is_detected_with_one_object_detection_and_one_classification_model
✅ test_camera_decision_should_return_no_decision_without_inference_results
tests.unit_tests.domain.models.business_rule.test_item_business_rules.TestItemBusinessRule
✅ test_item_decision_should_return_decision_ko_when_one_or_more_than_one_camera_decision_is_ko
✅ test_item_decision_should_return_decision_ok_when_more_than_50_pct_of_camera_decisions_are_ok
✅ test_item_decision_should_return_no_decision_ko_with_no_camera_decision
tests.unit_tests.infrastructure.binary_storage.test_filesystem_binary_storage.TestFileSystemBinaryStorage
✅ test_save_item_binaries_should_write_image_on_filesystem
❌ test_get_item_binary_should_return_requested_item_binary
self = <test_filesystem_binary_storage.TestFileSystemBinaryStorage object at 0x7f07518dc670>
❌ test_get_item_binaries_should_return_all_item_binaries_names
self = <test_filesystem_binary_storage.TestFileSystemBinaryStorage object at 0x7f07518dc550>
tests.unit_tests.infrastructure.binary_storage.test_gcp_binary_storage.TestGCPBinaryStorage
❌ test_save_item_binaries_should_write_image_in_gcp
self = <test_gcp_binary_storage.TestGCPBinaryStorage object at 0x7f0750580a90>
❌ test_get_item_binary_should_return_image
self = <test_gcp_binary_storage.TestGCPBinaryStorage object at 0x7f07505a4670>
tests.unit_tests.infrastructure.binary_storage.test_memory_binary_storage.TestMemoryBinaryStorage
❌ test_save_item_binaries_should_write_image_in_memory
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4a60>
❌ test_get_item_binary_should_return_requested_item_binary
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4be0>
❌ test_get_item_binaries_should_return_all_item_binaries_names
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4d00>
tests.unit_tests.infrastructure.camera.test_fake_camera.TestFakeCamera
✅ test_select_random_image_should_return_random_image_from_input_images_folder
tests.unit_tests.infrastructure.metadata_storage.test_filesystem_metadata_storage.TestFileSystemMetadataStorage
✅ test_save_item_metadata_should_write_metadata_on_filesystem
❌ test_get_item_metadata_should_return_requested_item_metadata
self = <test_filesystem_metadata_storage.TestFileSystemMetadataStorage object at 0x7f07505515b0>
❌ test_get_item_state_should_return_expected_state
self = <test_filesystem_metadata_storage.TestFileSystemMetadataStorage object at 0x7f0750551220>
❌ test_get_all_items_metadata_should_return_expected_metadata_list
self = <test_filesystem_metadata_storage.TestFileSystemMetadataStorage object at 0x7f0750551460>
tests.unit_tests.infrastructure.metadata_storage.test_memory_item_storage.TestMemoryItemStorage
✅ test_save_item_metadata_should_write_item_in_memory
✅ test_get_item_metadata_should_return_requested_item_metadata
✅ test_get_all_items_metadata_should_return_all_items
tests.unit_tests.infrastructure.model_forward.test_fake_model_forwarder.TestFakeModelForwarder
✅ test_perform_inference_should_return_classification_results
✅ test_perform_inference_should_return_object_detection_results
✅ test_perform_inference_should_return_object_detection_with_classification_results
tests.unit_tests.infrastructure.model_forward.test_tf_serving_classification_wrapper.TestClassifModelHelper
✅ test_perform_pre_processing_should_return_an_image_as_an_array_with_the_expected_format
✅ test_perform_post_processing_should_transform_the_standard_output_from_the_model_into_the_expected_format
tests.unit_tests.infrastructure.model_forward.test_tf_serving_detection_and_classification_wrapper.TestDetectionClassificationHelper
✅ test_perform_pre_processing_should_return_an_image_as_an_array_with_the_expected_format
✅ test_perform_post_processing_should_transform_the_standard_output_from_the_model_into_the_expected_format
tests.unit_tests.infrastructure.model_forward.test_tf_serving_detection_wrapper.TestDetectionWrapperHelper
✅ test_perform_pre_processing_should_return_an_image_as_an_array_with_the_expected_format
✅ test_perform_post_processing_should_transform_the_standard_output_from_the_model_into_the_expected_format
Annotations
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.domain.test_supervisor.TestSupervisor ► test_set_decision_should_send_final_decision_to_telemetry_sink
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_supervisor.TestSupervisor object at 0x7f075193a2e0>
Raw output
self = <test_supervisor.TestSupervisor object at 0x7f075193a2e0>
mock_send = <AsyncMock name='send' id='139669387288432'>
@patch.object(PostgresTelemetrySink, "send")
async def test_set_decision_should_send_final_decision_to_telemetry_sink(self, mock_send):
# Given
item = Item(serial_number="", category="", cameras_metadata={}, binaries={}, dimensions=[])
item.id = "item_id"
inventory = JsonInventory(TEST_INVENTORY_PATH)
station_config = JsonStationConfig(TEST_STATION_CONFIGS_FOLDER_PATH, inventory, TEST_DATA_FOLDER_PATH)
station_config.set_station_config("station_config_TEST")
supervisor = Supervisor(
station_config=station_config,
metadata_storage=MemoryMetadataStorage(),
model_forward=FakeModelForward(),
binary_storage=MemoryBinaryStorage(),
)
# When
await supervisor.inspect(item)
# Then
msg_dict = {
"item_id": "item_id",
"config": "station_config_TEST",
"decision": "NO_DECISION",
}
> mock_send.assert_called_once_with(msg_dict)
tests/unit_tests/domain/test_supervisor.py:548:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/mock.py:925: in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <AsyncMock name='send' id='139669387288432'>
args = ({'config': 'station_config_TEST', 'decision': 'NO_DECISION', 'item_id': 'item_id'},)
kwargs = {}
expected = (({'config': 'station_config_TEST', 'decision': 'NO_DECISION', 'item_id': 'item_id'},), {})
actual = call({'item_id': 'item_id', 'config': 'station_config_TEST', 'decision': 'OK'})
_error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7f0750301790>
cause = None
def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.
Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
if self.call_args is None:
expected = self._format_mock_call_signature(args, kwargs)
actual = 'not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'
% (expected, actual))
raise AssertionError(error_message)
def _error_message():
msg = self._format_mock_failure_message(args, kwargs)
return msg
expected = self._call_matcher((args, kwargs))
actual = self._call_matcher(self.call_args)
if expected != actual:
cause = expected if isinstance(expected, Exception) else None
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: send({'item_id': 'item_id', 'config': 'station_config_TEST', 'decision': 'NO_DECISION'})
E Actual: send({'item_id': 'item_id', 'config': 'station_config_TEST', 'decision': 'OK'})
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/unittest/mock.py:913: AssertionError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.domain.test_supervisor.TestSupervisor ► test_inspect_should_log_information_about_item_processing
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_supervisor.TestSupervisor object at 0x7f075193a3d0>
Raw output
self = <test_supervisor.TestSupervisor object at 0x7f075193a3d0>
caplog = <_pytest.logging.LogCaptureFixture object at 0x7f075036a5b0>
my_fake_item = <edge_orchestrator.domain.models.item.Item object at 0x7f075036ac40>
async def test_inspect_should_log_information_about_item_processing(self, caplog, my_fake_item):
# Given
expected_messages = [
"Activated the configuration station_config_TEST",
"Starting Capture",
"Entering try Capture",
"End of Capture",
"Starting Save Binaries",
"Entering try Save Binaries",
"End of Save Binaries",
"Starting Inference",
"Entering try Inference",
"Getting inference for model model_id4",
"End of Inference",
"Starting Decision",
"Entering try Decision",
"End of Decision",
]
inventory = JsonInventory(TEST_INVENTORY_PATH)
station_config = JsonStationConfig(TEST_STATION_CONFIGS_FOLDER_PATH, inventory, TEST_DATA_FOLDER_PATH)
station_config.set_station_config("station_config_TEST")
supervisor = Supervisor(
station_config=station_config,
metadata_storage=MemoryMetadataStorage(),
model_forward=FakeModelForward(),
binary_storage=MemoryBinaryStorage(),
telemetry_sink=FakeTelemetrySink(),
)
# When
with caplog.at_level(logging.INFO, logger="edge_orchestrator"):
await supervisor.inspect(my_fake_item)
# Then
actual_messages = [
logger_msg
for logger_name, logger_level, logger_msg in caplog.record_tuples
if logger_name == "edge_orchestrator"
]
> assert expected_messages == actual_messages
E AssertionError: assert ['Activated t...inaries', ...] == ['Activated t...inaries', ...]
E At index 1 diff: 'Starting Capture' != 'Activated the configuration station_config_TEST'
E Right contains 2 more items, first extra item: 'Entering try Decision'
E Full diff:
E [
E - 'Activated the configuration station_config_TEST',
E 'Activated the configuration station_config_TEST',
E 'Starting Capture',
E 'Entering try Capture',
E 'End of Capture',
E 'Starting Save Binaries',
E 'Entering try Save Binaries',
E - 'Error during Save Binaries: save_item_binaries() takes 2 positional '
E - 'arguments but 3 were given',
E 'End of Save Binaries',
E 'Starting Inference',
E 'Entering try Inference',
E 'Getting inference for model model_id4',
E 'End of Inference',
E 'Starting Decision',
E 'Entering try Decision',
E 'End of Decision',
E ]
tests/unit_tests/domain/test_supervisor.py:590: AssertionError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.domain.models.test_edge_station.TestEdgeStation ► test_register_cameras_raises_exception_when_no_active_configuration_is_set
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_edge_station.TestEdgeStation object at 0x7f075193aa60>
Raw output
self = <test_edge_station.TestEdgeStation object at 0x7f075193aa60>
def test_register_cameras_raises_exception_when_no_active_configuration_is_set(
self,
):
# Given
station_config: StationConfig = get_station_config()
edge_station = EdgeStation(station_config)
# Then
with pytest.raises(TypeError) as error:
> edge_station.register_cameras(station_config)
E Failed: DID NOT RAISE <class 'TypeError'>
tests/unit_tests/domain/models/test_edge_station.py:24: Failed
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_filesystem_binary_storage.TestFileSystemBinaryStorage ► test_get_item_binary_should_return_requested_item_binary
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_filesystem_binary_storage.TestFileSystemBinaryStorage object at 0x7f07518dc670>
Raw output
self = <test_filesystem_binary_storage.TestFileSystemBinaryStorage object at 0x7f07518dc670>
tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_get_item_binary_should_re0')
def test_get_item_binary_should_return_requested_item_binary(self, tmpdir):
# Given
src_directory_path = Path(tmpdir.mkdir("binaries"))
expected_picture = bytes([0, 1, 2, 3, 4])
active_config_name = "detection_model"
binary_storage = FileSystemBinaryStorage(src_directory_path, active_config_name)
(src_directory_path / active_config_name / "my_item_id").mkdir(parents=True)
with (src_directory_path / active_config_name / "my_item_id" / "camera_id.jpg").open("wb") as f:
f.write(expected_picture)
# When
> actual_binary = binary_storage.get_item_binary("my_item_id", "camera_id", active_config_name)
E TypeError: get_item_binary() takes 3 positional arguments but 4 were given
tests/unit_tests/infrastructure/binary_storage/test_filesystem_binary_storage.py:48: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_filesystem_binary_storage.TestFileSystemBinaryStorage ► test_get_item_binaries_should_return_all_item_binaries_names
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_filesystem_binary_storage.TestFileSystemBinaryStorage object at 0x7f07518dc550>
Raw output
self = <test_filesystem_binary_storage.TestFileSystemBinaryStorage object at 0x7f07518dc550>
tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_get_item_binaries_should_0')
def test_get_item_binaries_should_return_all_item_binaries_names(self, tmpdir):
# Given
src_directory_path = Path(tmpdir.mkdir("binaries"))
expected_picture_1 = bytes([0, 1, 2, 3, 4])
expected_picture_2 = bytes([5, 6, 7, 8, 9])
active_config_name = "detection_model"
binary_storage = FileSystemBinaryStorage(src_directory_path, active_config_name)
(src_directory_path / active_config_name / "my_item_id").mkdir(parents=True)
with (src_directory_path / active_config_name / "my_item_id" / "camera_id1.jpg").open("wb") as f_1:
with ((src_directory_path / active_config_name / "my_item_id" / "camera_id2.jpg")).open("wb") as f_2:
f_1.write(expected_picture_1)
f_2.write(expected_picture_2)
# When
> binaries_names = binary_storage.get_item_binaries("my_item_id", active_config_name)
E TypeError: get_item_binaries() takes 2 positional arguments but 3 were given
tests/unit_tests/infrastructure/binary_storage/test_filesystem_binary_storage.py:69: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_gcp_binary_storage.TestGCPBinaryStorage ► test_save_item_binaries_should_write_image_in_gcp
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_gcp_binary_storage.TestGCPBinaryStorage object at 0x7f0750580a90>
Raw output
self = <test_gcp_binary_storage.TestGCPBinaryStorage object at 0x7f0750580a90>
mock_storage = <MagicMock name='storage' id='139669387072704'>
@patch("edge_orchestrator.infrastructure.binary_storage.gcp_binary_storage.storage")
def test_save_item_binaries_should_write_image_in_gcp(self, mock_storage):
# Given
test_active_config_name = "test_config"
test_camera_id = "1"
test_file_path = TEST_DATA_FOLDER_PATH / EDGE_NAME / test_active_config_name / "item_2" / "camera_id1.jpg"
item = Item.from_nothing()
with open(test_file_path, "rb") as f:
item.binaries = {test_camera_id: f}
mock_gcs_client = mock_storage.Client.return_value
mock_bucket = Mock()
mock_gcs_client.get_bucket.return_value = mock_bucket
> gcs = GCPBinaryStorage(prefix=EDGE_NAME)
E TypeError: __init__() missing 1 required positional argument: 'active_config_name'
tests/unit_tests/infrastructure/binary_storage/test_gcp_binary_storage.py:23: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_gcp_binary_storage.TestGCPBinaryStorage ► test_get_item_binary_should_return_image
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_gcp_binary_storage.TestGCPBinaryStorage object at 0x7f07505a4670>
Raw output
self = <test_gcp_binary_storage.TestGCPBinaryStorage object at 0x7f07505a4670>
mock_storage = <MagicMock name='storage' id='139669383925872'>
@patch("edge_orchestrator.infrastructure.binary_storage.gcp_binary_storage.storage")
def test_get_item_binary_should_return_image(self, mock_storage):
# Given
test_active_config_name = "test_config"
test_camera_id = "1"
test_file_path = TEST_DATA_FOLDER_PATH / EDGE_NAME / test_active_config_name / "item_2" / "camera_id1.jpg"
item = Item.from_nothing()
with open(test_file_path, "rb") as f:
item.binaries = {test_camera_id: f}
mock_gcs_client = mock_storage.Client.return_value
mock_bucket = Mock()
mock_gcs_client.get_bucket.return_value = mock_bucket
> gcs = GCPBinaryStorage(prefix=EDGE_NAME)
E TypeError: __init__() missing 1 required positional argument: 'active_config_name'
tests/unit_tests/infrastructure/binary_storage/test_gcp_binary_storage.py:47: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_memory_binary_storage.TestMemoryBinaryStorage ► test_save_item_binaries_should_write_image_in_memory
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4a60>
Raw output
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4a60>
generate_id_mocked = <MagicMock name='generate_id' id='139669383893632'>
@patch("edge_orchestrator.domain.models.item.generate_id")
def test_save_item_binaries_should_write_image_in_memory(self, generate_id_mocked):
# Given
config_name_mocked = "test_config"
generate_id_mocked.return_value = "my_item_id"
binary_storage = MemoryBinaryStorage()
expected_picture = bytes([0, 1, 2, 3, 4])
item = Item(
serial_number="serial_number",
category="category",
cameras_metadata={},
binaries={"my_picture_name": expected_picture},
dimensions=[100, 100],
)
# When
> binary_storage.save_item_binaries(item, config_name_mocked)
E TypeError: save_item_binaries() takes 2 positional arguments but 3 were given
tests/unit_tests/infrastructure/binary_storage/test_memory_binary_storage.py:26: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_memory_binary_storage.TestMemoryBinaryStorage ► test_get_item_binary_should_return_requested_item_binary
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4be0>
Raw output
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4be0>
def test_get_item_binary_should_return_requested_item_binary(self):
# Given
config_name_mocked = "test_config"
binary_storage = MemoryBinaryStorage()
expected_picture = bytes([0, 1, 2, 3, 4])
another_picture = bytes([5, 6, 7, 8, 9])
binary_storage.binaries = {
"my_item_id": {
"my_picture_name_1": expected_picture,
"my_picture_name_2": another_picture,
}
}
# When
> binary = binary_storage.get_item_binary("my_item_id", "my_picture_name_1", config_name_mocked)
E TypeError: get_item_binary() takes 3 positional arguments but 4 were given
tests/unit_tests/infrastructure/binary_storage/test_memory_binary_storage.py:45: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.binary_storage.test_memory_binary_storage.TestMemoryBinaryStorage ► test_get_item_binaries_should_return_all_item_binaries_names
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4d00>
Raw output
self = <test_memory_binary_storage.TestMemoryBinaryStorage object at 0x7f07505a4d00>
def test_get_item_binaries_should_return_all_item_binaries_names(self):
# Given
config_name_mocked = "test_config"
binary_storage = MemoryBinaryStorage()
expected_picture_1 = bytes([0, 1, 2, 3, 4])
expected_picture_2 = bytes([5, 6, 7, 8, 9])
binary_storage.binaries = {
"my_item_id": {
"my_picture_name_1": expected_picture_1,
"my_picture_name_2": expected_picture_2,
}
}
# When
> binaries_names = binary_storage.get_item_binaries("my_item_id", config_name_mocked)
E TypeError: get_item_binaries() takes 2 positional arguments but 3 were given
tests/unit_tests/infrastructure/binary_storage/test_memory_binary_storage.py:64: TypeError
Check failure on line 0 in edge_orchestrator/reports/pytest/unit-tests-report.xml
github-actions / Unit tests report in Python 3.8
pytest ► tests.unit_tests.infrastructure.metadata_storage.test_filesystem_metadata_storage.TestFileSystemMetadataStorage ► test_get_item_metadata_should_return_requested_item_metadata
Failed test found in:
edge_orchestrator/reports/pytest/unit-tests-report.xml
Error:
self = <test_filesystem_metadata_storage.TestFileSystemMetadataStorage object at 0x7f07505515b0>
Raw output
self = <test_filesystem_metadata_storage.TestFileSystemMetadataStorage object at 0x7f07505515b0>
tmpdir = local('/tmp/pytest-of-runner/pytest-0/test_get_item_metadata_should_0')
my_cameras_metadata_0 = {'camera_1': {'brightness': 100, 'exposition': 100, 'position': 'right'}, 'camera_2': {'brightness': 100, 'exposition': 100, 'position': 'left'}}
def test_get_item_metadata_should_return_requested_item_metadata(self, tmpdir, my_cameras_metadata_0):
# Given
src_directory_path = Path(tmpdir.mkdir("metadata"))
active_config_name = "detection_model"
expected_metadata = my_cameras_metadata_0
(src_directory_path / active_config_name / "my_item_id").mkdir(parents=True)
with (src_directory_path / active_config_name / "my_item_id" / "metadata.json").open("w") as f:
json.dump(expected_metadata, f)
> metadata_storage = FileSystemMetadataStorage(src_directory_path)
E TypeError: __init__() missing 1 required positional argument: 'active_config_name'
tests/unit_tests/infrastructure/metadata_storage/test_filesystem_metadata_storage.py:61: TypeError