Skip to content

Feature/cleanup packaging #44

Feature/cleanup packaging

Feature/cleanup packaging #44

GitHub Actions / Test Report (3.8) failed Apr 16, 2024 in 0s

98 tests run, 84 passed, 0 skipped, 14 failed.

Annotations

Check failure on line 1 in TestListEndpointsService

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestListEndpointsService.test_list_endpoints_without_filters_should_return_all_the_available_endpoints_with_all_possible_message_types

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_list_endpoints_service.TestListEndpointsService testMethod=test_list_endpoints_without_filters_should_return_all_the_available_endpoints_with_all_possible_message_types>

    def test_list_endpoints_without_filters_should_return_all_the_available_endpoints_with_all_possible_message_types(
            self):
        """
        Testing list endpoints service
        """
        self._log.info("Starting test for list endpoints service to return all endpoints")
    
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
            on_message_callback=self._list_endpoints_service_for_all_endpoints_callback())
    
        list_endpoints_parameters = ListEndpointsParameters(application_message_id=new_uuid(),
                                                            application_message_seq_no=current_sequence_number,
                                                            onboarding_response=self._recipient_onboard_response,
                                                            )
    
        list_endpoints_service = ListEndpointsService(self._messaging_service_for_recipient)
        list_endpoints_service.send(list_endpoints_parameters)
        Sleeper.process_the_command()
    
        if not self._callback_for_list_endpoints_service_processed:
            self._log.error("Either the callback was not processed in time or there was an error during the checks.")
>       self.assertTrue(self._callback_for_list_endpoints_service_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_list_endpoints_service.py:131: AssertionError

Check failure on line 1 in TestSendDirectMessageService

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestSendDirectMessageService.test_given_valid_message_content_when_sending_message_to_single_recipient_then_the_message_should_be_delivered

AttributeError: 'SendMessageParameters' object has no attribute '_recipients'
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_publish_message_service.TestSendDirectMessageService testMethod=test_given_valid_message_content_when_sending_message_to_single_recipient_then_the_message_should_be_delivered>

    def test_given_valid_message_content_when_sending_message_to_single_recipient_then_the_message_should_be_delivered(
            self):
        """
        Test for publishing the valid message content to a single recipient after enabling IMG_PNG capability with
        sender and recipient Open Connection between Recipient and agrirouter is required. The setup between the
        sender and the recipient are done before running the test.
        """
    
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._sender.get_sensor_alternate_id())
    
        send_message_parameters = SendMessageParameters(
            onboarding_response=self._sender,
            technical_message_type=CapabilityType.IMG_PNG.value,
            application_message_id=new_uuid(),
            application_message_seq_no=current_sequence_number,
            base64_message_content=DataProvider.read_base64_encoded_image(),
            mode=RequestEnvelope.Mode.Value("PUBLISH"))
    
        send_message_service = SendMessageService(messaging_service=self._messaging_service_for_sender)
>       send_message_service.send(send_message_parameters)

tests/agrirouter/service/messaging/mqtt/test_publish_message_service.py:81: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/agrirouter/messaging/services/commons.py:36: in send
    encoded_messages = self.encode(parameters)
src/agrirouter/messaging/services/messaging.py:282: in encode
    recipients=parameters.get_recipients(),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <agrirouter.messaging.parameters.dto.SendMessageParameters object at 0x7f40e35b2790>

    def get_recipients(self) -> list:
>       return self._recipients
E       AttributeError: 'SendMessageParameters' object has no attribute '_recipients'

src/agrirouter/messaging/parameters/dto.py:150: AttributeError

Check failure on line 1 in TestQueryHeaderService

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryHeaderService.test_header_query_service_for_specific_message_ids_should_return_the_messages_for_this_specific_message_ids

AssertionError: unexpectedly None
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_header_service.TestQueryHeaderService testMethod=test_header_query_service_for_specific_message_ids_should_return_the_messages_for_this_specific_message_ids>

    def test_header_query_service_for_specific_message_ids_should_return_the_messages_for_this_specific_message_ids(
            self):
        """
        Testing query header service when specific message id is specified
        """
        self._log.info("Testing header query service with specific message id")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
>       self.assertIsNotNone(self._received_messages)
E       AssertionError: unexpectedly None

tests/agrirouter/service/messaging/mqtt/test_query_header_service.py:226: AssertionError

Check failure on line 1 in TestQueryHeaderService

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryHeaderService.test_header_query_service_when_senders_is_specified_should_return_the_header_for_this_sender_id

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_header_service.TestQueryHeaderService testMethod=test_header_query_service_when_senders_is_specified_should_return_the_header_for_this_sender_id>

    def test_header_query_service_when_senders_is_specified_should_return_the_header_for_this_sender_id(self):
        """
        Testing query header service when the sender endpoint id is specified
        """
        self._log.info("Testing header query service with specific sender id")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
            on_message_callback=self._on_query_header_service_callback(None))
    
        query_header_parameters = QueryHeaderParameters(application_message_id=new_uuid(),
                                                        application_message_seq_no=current_sequence_number,
                                                        onboarding_response=self._recipient_onboard_response,
                                                        senders=[
                                                            self._sender_onboard_response.get_sensor_alternate_id()],
                                                        )
    
        query_header_service = QueryHeaderService(self._messaging_service_for_recipient)
        query_header_service.send(query_header_parameters)
        Sleeper.process_the_command()
    
        if not self._callback_for_feed_header_query_processed:
            self._log.error("Either the callback was not processed in time or there was an error during the checks.")
    
>       self.assertTrue(self._callback_for_feed_header_query_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_query_header_service.py:214: AssertionError

Check failure on line 1 in TestQueryHeaderService

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryHeaderService.test_header_query_service_when_validity_period_is_specified_should_return_messages_within_the_validity_period

AssertionError: unexpectedly None
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_header_service.TestQueryHeaderService testMethod=test_header_query_service_when_validity_period_is_specified_should_return_messages_within_the_validity_period>

    def test_header_query_service_when_validity_period_is_specified_should_return_messages_within_the_validity_period(
            self):
        """
        Testing query header service when the validity period is specified
        """
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        query_header_parameters = QueryHeaderParameters(application_message_id=new_uuid(),
                                                        application_message_seq_no=current_sequence_number,
                                                        onboarding_response=self._recipient_onboard_response,
                                                        validity_period=max_validity_period(),
                                                        )
    
>       self.assertIsNotNone(self._received_messages)
E       AssertionError: unexpectedly None

tests/agrirouter/service/messaging/mqtt/test_query_header_service.py:172: AssertionError

Check failure on line 1 in TestQueryMessageServiceForSingleMessage

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryMessageServiceForSingleMessage.test_message_query_service_when_message_id_is_specified_should_return_the_message_for_this_message_id

AttributeError: 'NoneType' object has no attribute 'header'
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_message_service.TestQueryMessageServiceForSingleMessage testMethod=test_message_query_service_when_message_id_is_specified_should_return_the_message_for_this_message_id>

    def test_message_query_service_when_message_id_is_specified_should_return_the_message_for_this_message_id(self):
        """
        Testing query message service when the message id is specified
        """
        self._log.info("Testing message query service with specific sender id")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
>           on_message_callback=self._on_query_message_service_callback([self._received_messages.header.message_id]))
E       AttributeError: 'NoneType' object has no attribute 'header'

tests/agrirouter/service/messaging/mqtt/test_query_message_service.py:193: AttributeError

Check failure on line 1 in TestQueryMessageServiceForSingleMessage

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryMessageServiceForSingleMessage.test_message_query_service_when_sender_is_specified_should_return_the_message_for_this_sender_id

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_message_service.TestQueryMessageServiceForSingleMessage testMethod=test_message_query_service_when_sender_is_specified_should_return_the_message_for_this_sender_id>

    def test_message_query_service_when_sender_is_specified_should_return_the_message_for_this_sender_id(self):
        """
        Testing query message service when the sender endpoint id is specified
        """
        self._log.info("Testing message query service with specific sender id")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
            on_message_callback=self._on_query_message_service_callback(None))
    
        query_message_parameters = QueryMessageParameters(application_message_id=new_uuid(),
                                                          application_message_seq_no=current_sequence_number,
                                                          onboarding_response=self._recipient_onboard_response,
                                                          senders=[
                                                              self._sender_onboard_response.get_sensor_alternate_id()],
                                                          )
    
        query_message_service = QueryMessagesService(self._messaging_service_for_recipient)
        query_message_service.send(query_message_parameters)
        Sleeper.process_the_command()
    
        if not self._callback_for_feed_message_query_processed:
            self._log.error("Either the callback was not processed in time or there was an error during the checks.")
    
>       self.assertTrue(self._callback_for_feed_message_query_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_query_message_service.py:180: AssertionError

Check failure on line 1 in TestQueryMessageServiceForSingleMessage

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryMessageServiceForSingleMessage.test_message_query_service_when_validity_period_is_specified_should_return_the_message_for_this_validity_period

AttributeError: 'NoneType' object has no attribute 'header'
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_message_service.TestQueryMessageServiceForSingleMessage testMethod=test_message_query_service_when_validity_period_is_specified_should_return_the_message_for_this_validity_period>

    def test_message_query_service_when_validity_period_is_specified_should_return_the_message_for_this_validity_period(
            self):
        """
        Testing query message service when the validation period is specified
        """
        self._log.info("Testing message query service with specific sender id")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
>           on_message_callback=self._on_query_message_service_callback([self._received_messages.header.message_id]))
E       AttributeError: 'NoneType' object has no attribute 'header'

tests/agrirouter/service/messaging/mqtt/test_query_message_service.py:136: AttributeError

Check failure on line 1 in TestQueryMessageServiceForSingleMessage

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryMessageServiceForSingleMessage.test_query_message_service_for_incorrect_message_ids_should_return_empty_message

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_message_service.TestQueryMessageServiceForSingleMessage testMethod=test_query_message_service_for_incorrect_message_ids_should_return_empty_message>

    def test_query_message_service_for_incorrect_message_ids_should_return_empty_message(self):
        """
        Testing query message service when incorrect message ids are specified
        """
        self._log.info("Testing query message service with incorrect message ids")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
            on_message_callback=self._empty_result_in_response_callback())
    
        query_message_parameters = QueryMessageParameters(application_message_id=new_uuid(),
                                                          application_message_seq_no=current_sequence_number,
                                                          onboarding_response=self._recipient_onboard_response,
                                                          message_ids=[new_uuid()],
                                                          )
    
        query_message_service = QueryMessagesService(self._messaging_service_for_recipient)
        query_message_service.send(query_message_parameters)
        Sleeper.process_the_command()
    
        if not self._callback_for_feed_message_query_processed:
            self._log.error("Either the callback was not processed in time or there was an error during the checks.")
    
>       self.assertTrue(self._callback_for_feed_message_query_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_query_message_service.py:237: AssertionError

Check failure on line 1 in TestQueryMessageServiceForSingleMessage

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryMessageServiceForSingleMessage.test_query_message_service_for_incorrect_sender_ids_should_return_empty_message

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_message_service.TestQueryMessageServiceForSingleMessage testMethod=test_query_message_service_for_incorrect_sender_ids_should_return_empty_message>

    def test_query_message_service_for_incorrect_sender_ids_should_return_empty_message(self):
        """
        Testing query message service when incorrect sender id is specified
        """
        self._log.info("Testing query message service with incorrect message ids")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
            on_message_callback=self._empty_result_in_response_callback())
    
        query_message_parameters = QueryMessageParameters(application_message_id=new_uuid(),
                                                          application_message_seq_no=current_sequence_number,
                                                          onboarding_response=self._recipient_onboard_response,
                                                          senders=[new_uuid()],
                                                          )
    
        query_message_service = QueryMessagesService(self._messaging_service_for_recipient)
        query_message_service.send(query_message_parameters)
        Sleeper.process_the_command()
    
        if not self._callback_for_feed_message_query_processed:
            self._log.error("Either the callback was not processed in time or there was an error during the checks.")
    
>       self.assertTrue(self._callback_for_feed_message_query_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_query_message_service.py:265: AssertionError

Check failure on line 1 in TestQueryMessageServiceForSingleMessage

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestQueryMessageServiceForSingleMessage.test_query_message_service_for_incorrect_validity_period_should_return_empty_message

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_query_message_service.TestQueryMessageServiceForSingleMessage testMethod=test_query_message_service_for_incorrect_validity_period_should_return_empty_message>

    def test_query_message_service_for_incorrect_validity_period_should_return_empty_message(self):
        """
        Testing query message service when incorrect message ids are specified
        """
        self._log.info("Testing query message service with invalid validation period")
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient_onboard_response.get_sensor_alternate_id())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient_onboard_response,
            on_message_callback=self._empty_result_in_response_callback())
    
        query_message_parameters = QueryMessageParameters(application_message_id=new_uuid(),
                                                          application_message_seq_no=current_sequence_number,
                                                          onboarding_response=self._recipient_onboard_response,
                                                          validity_period=validity_period_for_seconds(seconds=5),
                                                          )
    
        query_message_service = QueryMessagesService(self._messaging_service_for_recipient)
        query_message_service.send(query_message_parameters)
        Sleeper.process_the_command()
    
        if not self._callback_for_feed_message_query_processed:
            self._log.error("Either the callback was not processed in time or there was an error during the checks.")
    
>       self.assertTrue(self._callback_for_feed_message_query_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_query_message_service.py:293: AssertionError

Check failure on line 1 in TestSendAndReceiveChunkedMessages

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestSendAndReceiveChunkedMessages.test_receive_chunked_msgs_from_feed_when_sender_id_is_specified_should_return_the_header_for_this_sender_id

failed on setup with "AttributeError: extend"
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_send_and_receive_chunked_messages_from_the_feed.TestSendAndReceiveChunke...testMethod=test_receive_chunked_msgs_from_feed_when_sender_id_is_specified_should_return_the_header_for_this_sender_id>

    @pytest.fixture(autouse=True)
    def fixture(self):
        # Setup
        self._log.debug("Setup for the test case.")
        self._recipient = read_onboard_response(Identifier.MQTT_MESSAGES_RECIPIENT[Identifier.PATH])
        self._sender = read_onboard_response(Identifier.MQTT_MESSAGES_SENDER[Identifier.PATH])
    
>       self._send_direct_chunked_message()

tests/agrirouter/service/messaging/mqtt/test_send_and_receive_chunked_messages_from_the_feed.py:47: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/agrirouter/service/messaging/mqtt/test_send_and_receive_chunked_messages_from_the_feed.py:125: in _send_direct_chunked_message
    encoded_chunked_messages = encode_chunks_message(message_parameter_tuple=message_parameter_tuples)
src/agrirouter/messaging/encode.py:93: in encode_chunks_message
    return [encode_message(_tuple.message_header_parameters, _tuple.message_payload_parameters) for _tuple in
src/agrirouter/messaging/encode.py:93: in <listcomp>
    return [encode_message(_tuple.message_header_parameters, _tuple.message_payload_parameters) for _tuple in
src/agrirouter/messaging/encode.py:40: in encode_message
    request_envelope = encode_header(header_parameters)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

header_parameters = <agrirouter.messaging.parameters.service.MessageHeaderParameters object at 0x7f40e338fe50>

    def encode_header(header_parameters: MessageHeaderParameters) -> RequestEnvelope:
        """
        Encode header to RequestEnvelope protobuf
        :header_parameters: Message Header Parameters
        Returns RequestEnvelope with parameters set
        """
        request_envelope = RequestEnvelope()
        request_envelope.application_message_id = header_parameters.get_application_message_id() \
            if header_parameters.get_application_message_id() else new_uuid()
        request_envelope.application_message_seq_no = header_parameters.get_application_message_seq_no()
        request_envelope.technical_message_type = header_parameters.get_technical_message_type()
    
        request_envelope.mode = header_parameters.get_mode() \
            if header_parameters.get_mode() else RequestEnvelope.Mode.Value("DIRECT")
    
        if header_parameters.get_team_set_context_id() is not None:
            request_envelope.team_set_context_id = header_parameters.get_team_set_context_id()
        request_envelope.timestamp.FromDatetime(now_as_utc_timestamp())
        if header_parameters.get_recipients() is not None:
            request_envelope.recipients.extend(header_parameters.get_recipients())
        if header_parameters.get_chunk_component() is not None:
>           request_envelope.chunk_info.extend(header_parameters.get_chunk_component())
E           AttributeError: extend

src/agrirouter/messaging/encode.py:67: AttributeError

Check failure on line 1 in TestSendAndReceiveChunkedMessages

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestSendAndReceiveChunkedMessages.test_send_direct_chunked_message_with_valid_recipient_should_return_the_valid_chunked_message_content

AttributeError: extend
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_send_chunked_messages_and_receive_with_push_notifications.TestSendAndRec...sages testMethod=test_send_direct_chunked_message_with_valid_recipient_should_return_the_valid_chunked_message_content>

    def test_send_direct_chunked_message_with_valid_recipient_should_return_the_valid_chunked_message_content(self):
        """
        Test sending direct chunked messages with the push notifications enabled.
        The setup between recipient and sender, like, enabling capabilities and routing has been done prior to running
        this test
        """
        self._log.info("Testing send message service with the specified recipient")
    
        self._messaging_service_for_sender = MqttMessagingService(
            onboarding_response=self._sender,
            on_message_callback=self._non_checking_callback())
    
        self._messaging_service_for_recipient = MqttMessagingService(
            onboarding_response=self._recipient,
            on_message_callback=self._callback_to_set_the_received_message_ids())
    
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._recipient.get_sensor_alternate_id())
    
        message_header_parameters = MessageHeaderParameters(application_message_id=new_uuid(),
                                                            application_message_seq_no=current_sequence_number,
                                                            technical_message_type=CapabilityType.IMG_BMP.value,
                                                            recipients=[
                                                                self._recipient.get_sensor_alternate_id()],
                                                            mode=RequestEnvelope.Mode.Value("DIRECT"))
    
        message_payload_parameters = MessagePayloadParameters(type_url=TechnicalMessageType.EMPTY.value,
                                                              value=DataProvider.read_base64_encoded_large_bmp())
    
        message_parameter_tuples = chunk_and_base64encode_each_chunk(header_parameters=message_header_parameters,
                                                                     payload_parameters=message_payload_parameters,
                                                                     onboarding_response=self._sender)
    
        for _tuple in message_parameter_tuples:
            self._chunked_message_to_verify.append(_tuple.message_payload_parameters.get_value())
            assert len(_tuple.message_payload_parameters.get_value()) <= self._MAX_CHUNK_SIZE
    
>       encoded_chunked_messages = encode_chunks_message(message_parameter_tuple=message_parameter_tuples)

tests/agrirouter/service/messaging/mqtt/test_send_chunked_messages_and_receive_with_push_notifications.py:121: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/agrirouter/messaging/encode.py:93: in encode_chunks_message
    return [encode_message(_tuple.message_header_parameters, _tuple.message_payload_parameters) for _tuple in
src/agrirouter/messaging/encode.py:93: in <listcomp>
    return [encode_message(_tuple.message_header_parameters, _tuple.message_payload_parameters) for _tuple in
src/agrirouter/messaging/encode.py:40: in encode_message
    request_envelope = encode_header(header_parameters)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

header_parameters = <agrirouter.messaging.parameters.service.MessageHeaderParameters object at 0x7f40e346cb20>

    def encode_header(header_parameters: MessageHeaderParameters) -> RequestEnvelope:
        """
        Encode header to RequestEnvelope protobuf
        :header_parameters: Message Header Parameters
        Returns RequestEnvelope with parameters set
        """
        request_envelope = RequestEnvelope()
        request_envelope.application_message_id = header_parameters.get_application_message_id() \
            if header_parameters.get_application_message_id() else new_uuid()
        request_envelope.application_message_seq_no = header_parameters.get_application_message_seq_no()
        request_envelope.technical_message_type = header_parameters.get_technical_message_type()
    
        request_envelope.mode = header_parameters.get_mode() \
            if header_parameters.get_mode() else RequestEnvelope.Mode.Value("DIRECT")
    
        if header_parameters.get_team_set_context_id() is not None:
            request_envelope.team_set_context_id = header_parameters.get_team_set_context_id()
        request_envelope.timestamp.FromDatetime(now_as_utc_timestamp())
        if header_parameters.get_recipients() is not None:
            request_envelope.recipients.extend(header_parameters.get_recipients())
        if header_parameters.get_chunk_component() is not None:
>           request_envelope.chunk_info.extend(header_parameters.get_chunk_component())
E           AttributeError: extend

src/agrirouter/messaging/encode.py:67: AttributeError

Check failure on line 1 in TestSendDirectMessageService

See this annotation in the file changed.

@github-actions github-actions / Test Report (3.8)

TestSendDirectMessageService.test_given_valid_message_content_when_sending_message_to_single_recipient_then_the_message_should_be_delivered

AssertionError: False is not true
Raw output
self = <tests.agrirouter.service.messaging.mqtt.test_send_direct_message_service.TestSendDirectMessageService testMethod=test_given_valid_message_content_when_sending_message_to_single_recipient_then_the_message_should_be_delivered>

    def test_given_valid_message_content_when_sending_message_to_single_recipient_then_the_message_should_be_delivered(
            self):
        """
        Test for sending the valid message content to a single recipient after enabling IMG_PNG capability with
        sender and recipient Open Connection between Recipient and agrirouter is required. The setup between the
        sender and the recipient are done before running the test.
        """
    
        current_sequence_number = SequenceNumberService.next_seq_nr(
            self._sender.get_sensor_alternate_id())
    
        send_message_parameters = SendMessageParameters(
            onboarding_response=self._sender,
            technical_message_type=CapabilityType.IMG_PNG.value,
            application_message_id=new_uuid(),
            application_message_seq_no=current_sequence_number,
            recipients=[self._recipient.get_sensor_alternate_id()],
            base64_message_content=DataProvider.read_base64_encoded_image(),
            mode=RequestEnvelope.Mode.Value("DIRECT"))
    
        send_message_service = SendMessageService(messaging_service=self._messaging_service_for_sender)
        send_message_service.send(send_message_parameters)
        Sleeper.process_the_message()
    
        if not self._callback_for_sender_processed:
            self._log.error(
                "Either the callback for the sender was not processed "
                "in time or there was an error during the checks.")
    
        if not self._callback_for_recipient_processed:
            self._log.error(
                "Either the callback for the recipient was not processed "
                "in time or there was an error during the checks.")
    
        self.assertTrue(self._callback_for_sender_processed)
>       self.assertTrue(self._callback_for_recipient_processed)
E       AssertionError: False is not true

tests/agrirouter/service/messaging/mqtt/test_send_direct_message_service.py:96: AssertionError