    def test_cleanup_user(self):
        '''
        Test users being cleaned up properly.

        ... or at least the active_users dictionary having an element removed.
        '''
        # We'll mock a user using a dictionary since that's easier...
        user = {'id': '1234', 'name': 'mock-user'}
        fake_user = {'id': '5678', 'name': 'fake-user'}
        sb = bot.SecurityBot(None, None, None)
        sb.active_users = {user['id']: user}
        assert len(sb.active_users) == 1
        sb.cleanup_user(fake_user)
        assert len(sb.active_users) == 1
        sb.cleanup_user(user)
        assert len(sb.active_users) == 0
Test users being cleaned up properly.

... or at least the active_users dictionary having an element removed.
tests/bot_test.py