Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_yelling occasionally fails #495

Open
bradleysigma opened this issue Nov 8, 2019 · 4 comments · Fixed by #546
Open

test_yelling occasionally fails #495

bradleysigma opened this issue Nov 8, 2019 · 4 comments · Fixed by #546

Comments

@bradleysigma
Copy link
Contributor

bradleysigma commented Nov 8, 2019

    def test_minuscule(uqcsbot: MockUQCSBot):
        """
        test minuscule string
        """
        uqcsbot.post_message(TEST_CHANNEL_ID, "wintermute")
>       assert len(uqcsbot.test_messages.get(TEST_CHANNEL_ID, [])) == 2
E       AssertionError: assert 3 == 2
E        +  where 3 = len([{'channel': 'C1234567890', 'text': 'wintermute', 'ts': '1573201241.7311587', 'type': 'message', ...}, {'channel': 'C1... 'message', ...}, {'channel': 'C1234567890', 'text': 'WHATS THAT', 'ts': '1573201241.73277', 'type': 'message', ...}])
E        +    where [{'channel': 'C1234567890', 'text': 'wintermute', 'ts': '1573201241.7311587', 'type': 'message', ...}, {'channel': 'C1... 'message', ...}, {'channel': 'C1234567890', 'text': 'WHATS THAT', 'ts': '1573201241.73277', 'type': 'message', ...}] = <built-in method get of collections.defaultdict object at 0x7fffead14db8>('C1234567890', [])
E        +      where <built-in method get of collections.defaultdict object at 0x7fffead14db8> = defaultdict(<class 'list'>, {'C1234567890': [{'type': 'message', 'ts': '1573201241.7311587', 'user': 'B1234567890', 't...type': 'message', 'ts': '1573201241.73277', 'user': 'B1234567890', 'text': 'WHAT’S THAT‽', 'channel': 'C1234567890'}]}).get
E        +        where defaultdict(<class 'list'>, {'C1234567890': [{'type': 'message', 'ts': '1573201241.7311587', 'user': 'B1234567890', 't...type': 'message', 'ts': '1573201241.73277', 'user': 'B1234567890', 'text': 'WHAT’S THAT‽', 'channel': 'C1234567890'}]}) = <test.conftest.MockUQCSBot object at 0x7fffead1e908>.test_messages

test/test_yelling.py:12: AssertionError

Commenting retest this please can cause the tests to pass.

@bradleysigma
Copy link
Contributor Author

bradleysigma commented Oct 3, 2020

This is probably caused by the f"WHAT IS THE MEANING OF THIS ARCANE SYMBOL “{random_minuscule(text)}”‽ I RECOGNISE IT NOT!" and 'OH, NO! NOT THE `a`S! NOT THE `a`S! AAAAAHHHHH!' responses, which has a minuscule letting in it, causing the bot to reply to itself (thus three messages).

@nicklambourne
Copy link
Member

nicklambourne commented Oct 3, 2020

You can fix this with a mock of random_minuscule.

@bradleysigma
Copy link
Contributor Author

bradleysigma commented Oct 3, 2020

#546 also fixes the problem (and in a better way, too).

@bradleysigma
Copy link
Contributor Author

DISREGARD THAT.

@bradleysigma bradleysigma reopened this Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants