Exemplo n.º 1
0
 def test_choose_multiple(self):
     self.input.group = lambda x: [
         '.choose', 'dog cat hamster goldfish turtle'
     ][x]
     possibilities = {'dog', 'cat', 'hamster', 'goldfish', 'turtle'}
     choose.choose(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue(out in possibilities)
Exemplo n.º 2
0
 def test_choose_invalid(self):
     self.input.group = lambda x: ['.choose', ''][x]
     choose.choose(self.phenny, self.input)
     self.phenny.say.assert_called_once_with('.choose <red> <blue> - for when you just can\'t decide')
Exemplo n.º 3
0
 def test_choose_single(self):
     self.input.group = lambda x: ['.choose', 'haha'][x]
     choose.choose(self.phenny, self.input)
     self.phenny.reply.assert_called_once_with('haha')
Exemplo n.º 4
0
 def test_choose_multiple(self):
     self.input.group = lambda x: ['.choose', 'dog cat hamster goldfish turtle'][x]
     possibilities = {'dog', 'cat', 'hamster', 'goldfish', 'turtle'}
     choose.choose(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue(out in possibilities)
Exemplo n.º 5
0
 def test_choose_numerals(self):
     self.input.group = lambda x: ['.choose', '2 3'][x]
     choose.choose(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue(out == '2' or out == '3')
Exemplo n.º 6
0
 def test_choose_strings(self):
     self.input.group = lambda x: ['.choose', 'canada usa'][x]
     choose.choose(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue(out == 'canada' or out == 'usa')
Exemplo n.º 7
0
 def test_choose_invalid(self):
     self.input.group = lambda x: ['.choose', ''][x]
     choose.choose(self.phenny, self.input)
     self.phenny.say.assert_called_once_with(
         '.choose <red> <blue> - for when you just can\'t decide')
Exemplo n.º 8
0
 def test_choose_single(self):
     self.input.group = lambda x: ['.choose', 'haha'][x]
     choose.choose(self.phenny, self.input)
     self.phenny.reply.assert_called_once_with('haha')
Exemplo n.º 9
0
 def test_choose_numerals(self):
     self.input.group = lambda x: ['.choose', '2 3'][x]
     choose.choose(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue(out == '2' or out == '3')
Exemplo n.º 10
0
 def test_choose_strings(self):
     self.input.group = lambda x: ['.choose', 'canada usa'][x]
     choose.choose(self.phenny, self.input)
     out = self.phenny.reply.call_args[0][0]
     self.assertTrue(out == 'canada' or out == 'usa')