示例#1
0
 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)
示例#2
0
文件: test_hs.py 项目: goavki/phenny
 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)
示例#3
0
 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)
示例#4
0
文件: test_hs.py 项目: goavki/phenny
 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)
示例#5
0
    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)
示例#6
0
    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)
示例#7
0
文件: test_hs.py 项目: vtluug/phenny
    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)
示例#8
0
文件: test_hs.py 项目: vtluug/phenny
    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)
示例#9
0
    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)
示例#10
0
    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)
示例#11
0
 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")
示例#12
0
 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")
示例#13
0
文件: test_hs.py 项目: goavki/phenny
 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")
示例#14
0
文件: test_hs.py 项目: goavki/phenny
 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")
示例#15
0
文件: test_hs.py 项目: vtluug/phenny
    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")
示例#16
0
文件: test_hs.py 项目: vtluug/phenny
    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")