    def test_valid_user_empty(self):
        '''Tests valid_user with a malformed user.'''
        sb = bot.SecurityBot(None, None, None)
        user = {'id': '1234', 'name': 'mock-user'}
        sb.users = {user['id']: user}
        sb.users_by_name = {user['name']: user}
        assert not sb.valid_user('')
Tests valid_user with a malformed user.
tests/bot_test.py