Exemplo n.º 1
0
 def __init__(self, sender='*****@*****.**', body=''):
   self.sender = sender
   self.body = body
   self.command, self.arg = SlashlessCommandMessage.extract_command_and_arg_from_string(body)
   self.message_to_send = None
Exemplo n.º 2
0
 def __init__(self, sender='*****@*****.**', body=''):
     self.sender = sender
     self.body = body
     self.command, self.arg = SlashlessCommandMessage.extract_command_and_arg_from_string(
         body)
     self.message_to_send = None
 def test_extracts_all_commands(self):
   for command in XmppHandler.PERMITTED_COMMANDS:
     self.assertEquals(command, SlashlessCommandMessage.extract_command_and_arg_from_string(command)[0])
 def test_extracts_all_commands_surrounded_with_space(self):
   for command in XmppHandler.PERMITTED_COMMANDS:
     self.assertEquals(command, SlashlessCommandMessage.extract_command_and_arg_from_string(' ' + command + ' ')[0])
 def test_extracts_symbol_as_command_given_symbol(self):
   self.assertEquals('?', SlashlessCommandMessage.extract_command_and_arg_from_string('?')[0])