caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
10.9k stars 384 forks source link

Issue with tests on ppc64le #1141

Closed raspbeguy closed 6 days ago

raspbeguy commented 2 weeks ago

:mega: Notification Service(s) Impacted not relevant

:lady_beetle: Describe the bug I'm the maintainer of the Alpine Linux package for apprise. Since version 1.8.0 we have an issue at test step specifically on ppc64le architecture. The failing test is test_apprise_attachment_truncate.

:bulb: Screenshots and Logs

_______________________ test_apprise_attachment_truncate _______________________
mock_get = <MagicMock name='get' id='140735561659216'>
    @mock.patch('requests.get')
    def test_apprise_attachment_truncate(mock_get):
        """
        API: AppriseAttachment when truncation in place

        """

        # Prepare our response
        response = requests.Request()
        response.status_code = requests.codes.ok

        # Prepare Mock
        mock_get.return_value = response

        # our Apprise Object
        ap_obj = Apprise()

        # Add ourselves an object set to truncate
        ap_obj.add('json://localhost/?method=GET&overflow=truncate')

        # Add ourselves a second object without truncate
        ap_obj.add('json://localhost/?method=GET&overflow=upstream')

        # Create ourselves an attachment object
        aa = AppriseAttachment()

        # There are no attachents loaded
        assert len(aa) == 0

        # Object can be directly checked as a boolean; response is False
        # when there are no entries loaded
        assert not aa

        # Add 2 attachments
        assert aa.add(join(TEST_VAR_DIR, 'apprise-test.gif'))
        assert aa.add(join(TEST_VAR_DIR, 'apprise-test.png'))

        assert mock_get.call_count == 0
        assert ap_obj.notify(body='body', title='title', attach=aa)

        assert mock_get.call_count == 2

        # Our first item was truncated, so only 1 attachment
        details = mock_get.call_args_list[0]
        dataset = json.loads(details[1]['data'])
>       assert len(dataset['attachments']) == 1
E       AssertionError: assert 2 == 1
E        +  where 2 = len([{'base64': 'R0lGODlhgAKAAuf/AAABACUXFDYjHk4nIkouJVAtO1ExOUI3M1U0PFI3PUM/Pkk+OVc6PE49OlA9NkZAOlY/Pk9COE9EP1pBPExGQHA9M...UAgEAgEAoFAIBAIBAKBQCAQCAQCXY7/BdZ8+WcJxLvGAAAAAElFTkSuQmCC', 'filename': 'apprise-test.png', 'mimetype': 'image/png'}])
test/test_apprise_attachments.py:312: AssertionError

:computer: Your System Details:

:crystal_ball: Additional context Architecture ppc64le Full build logs can be found here.

raspbeguy commented 6 days ago

up, please

raspbeguy commented 6 days ago

for some reason now the build runs ok. I guess the problem were coming from us. sorry for the inconvenience