def test_registration_completed(self): "First NICK, USER is received" self.registered(user=True) self.assertEqual( welcome(self.actor) + [M(self.actor, 'NICK', 'nick')], self.cmd.from_user('nick')) self.assertTrue(self.user.registered.nick)
def test_registration_completed(self): "First NICK, USER is received" self.registered(user=True) self.assertEqual( welcome(self.actor) + [M(self.actor, 'NICK', 'nick')], self.cmd.from_user('nick') ) self.assertTrue(self.user.registered.nick)
def test_after_nick(self): "NICK is received" server_patcher = patch('commands.nick.Server') mock_server = server_patcher.start() mock_server.all.return_value = [Mock] self.cmd.actor.is_user.return_value = True self.cmd.actor.user = self.cmd.user = user = self.users[0] user.registered.nick = True user.registered.user = False self.assertEqual( welcome(self.cmd.actor), self.cmd.from_user('username', 'hostname', 'servername', 'realname') ) self.assertTrue(self.cmd.user.registered.user)