Пример #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
 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
 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
    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
    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
 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
 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
    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
    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")