def test_multi(self): self.input.group.return_value = 'john' hs(self.phenny, self.input) pattern = re.compile( '^Multiple results found; try http://search\.vt\.edu/search/people\.html\?q=.*$', flags=re.UNICODE) out = self.phenny.reply.call_args[0][0] self.assertRegex(out, pattern)
def test_multi(self): self.input.group.return_value = 'john' hs.hs(self.phenny, self.input) pattern = re.compile( '^Multiple results found; try http://search\.vt\.edu/search/people\.html\?q=.*$', flags=re.UNICODE) out = self.phenny.reply.call_args[0][0] self.assertRegex(out, pattern)
def test_single(self): self.input.group.return_value = 'marchany' hs(self.phenny, self.input) pattern = re.compile( '^.* - http://search\.vt\.edu/search/person\.html\?person=\d+$', flags=re.UNICODE) out = self.phenny.reply.call_args[0][0] self.assertRegex(out, pattern)
def test_single(self): self.input.group.return_value = 'marchany' hs.hs(self.phenny, self.input) pattern = re.compile( '^.* - http://search\.vt\.edu/search/person\.html\?person=\d+$', flags=re.UNICODE) out = self.phenny.reply.call_args[0][0] self.assertRegex(out, pattern)
def test_multi(self): input = Mock(group=lambda x: 'john') hs(self.phenny, input) out = self.phenny.reply.call_args[0][0] m = re.match( '^Multiple results found; try http://search\.vt\.edu/search/people\.html\?q=.*$', out, flags=re.UNICODE) self.assertTrue(m)
def test_single(self): input = Mock(group=lambda x: 'marchany') hs(self.phenny, input) out = self.phenny.reply.call_args[0][0] m = re.match( '^.* - http://search\.vt\.edu/search/person\.html\?person=\d+$', out, flags=re.UNICODE) self.assertTrue(m)
def test_multi(self): input = Mock(group=lambda x: 'john') hs(self.phenny, input) pattern = re.compile( '^Multiple results found; try http://search\.vt\.edu/search/people\.html\?q=.*$', flags=re.UNICODE) out = self.phenny.reply.call_args[0][0] self.assertRegex(out, pattern)
def test_single(self): input = Mock(group=lambda x: 'marchany') hs(self.phenny, input) pattern = re.compile( '^.* - http://search\.vt\.edu/search/person\.html\?person=\d+$', flags=re.UNICODE) out = self.phenny.reply.call_args[0][0] self.assertRegex(out, pattern)
def test_none(self): self.input.group.return_value = 'THIS_IS_NOT_A_REAL_SEARCH_QUERY' hs(self.phenny, self.input) out = self.phenny.reply.call_args[0][0] self.phenny.reply.assert_called_once_with("No results found")
def test_2char(self): self.input.group.return_value = 'hs' hs(self.phenny, self.input) out = self.phenny.reply.call_args[0][0] self.phenny.reply.assert_called_once_with("No results found")
def test_none(self): self.input.group.return_value = 'THIS_IS_NOT_A_REAL_SEARCH_QUERY' hs.hs(self.phenny, self.input) out = self.phenny.reply.call_args[0][0] self.phenny.reply.assert_called_once_with("No results found")
def test_2char(self): self.input.group.return_value = 'hs' hs.hs(self.phenny, self.input) out = self.phenny.reply.call_args[0][0] self.phenny.reply.assert_called_once_with("No results found")
def test_none(self): input = Mock(group=lambda x: 'THIS_IS_NOT_A_REAL_SEARCH_QUERY') hs(self.phenny, input) out = self.phenny.reply.call_args[0][0] self.phenny.reply.assert_called_once_with("No results found")
def test_2char(self): input = Mock(group=lambda x: 'hs') hs(self.phenny, input) out = self.phenny.reply.call_args[0][0] self.phenny.reply.assert_called_once_with("No results found")