Esempio n. 1
0
    def test_wik_invalid(self):
        term = "New York City#Climate"
        input = Mock(groups=lambda: ['', term])
        wikipedia.wik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "Wikipedia for \"{0}\".".format(term))
Esempio n. 2
0
    def test_wik_none(self):
        term = "Ajgoajh"
        input = Mock(group=self.makegroup('', term))
        wikipedia.wik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "Wikipedia for \"{0}\".".format(term))
Esempio n. 3
0
    def test_wik_none(self):
        term = "Ajgoajh"
        input = Mock(group=self.makegroup('', term))
        wikipedia.wik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "Wikipedia for \"{0}\".".format(term))
Esempio n. 4
0
    def test_wik_invalid(self):
        term = "New York City#Climate"
        input = Mock(groups=lambda: ['', term])
        wikipedia.wik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "Wikipedia for \"{0}\".".format(term))
Esempio n. 5
0
    def test_wik(self):
        input = Mock(group=self.makegroup('', 'Human back'))
        wikipedia.wik(self.phenny, input)

        out = self.phenny.say.call_args[0][0]
        m = re.match('^.* - https:\/\/en\.wikipedia\.org\/wiki\/Human_back$',
                out, flags=re.UNICODE)
        self.assertTrue(m)
Esempio n. 6
0
    def test_wik_fragment(self):
        term = "New York City#Climate"
        input = Mock(group=self.makegroup('', term))
        wikipedia.wik(self.phenny, input)

        out = self.phenny.say.call_args[0][0]
        m = re.match('^.* - https:\/\/en\.wikipedia\.org\/wiki\/New_York_City#Climate$',
                out, flags=re.UNICODE)
        self.assertTrue(m)
Esempio n. 7
0
    def test_wik(self):
        input = Mock(group=self.makegroup('', 'Human back'))
        wikipedia.wik(self.phenny, input)

        out = self.phenny.say.call_args[0][0]
        m = re.match('^.* - https:\/\/en\.wikipedia\.org\/wiki\/Human_back$',
                     out,
                     flags=re.UNICODE)
        self.assertTrue(m)
Esempio n. 8
0
    def test_wik_none(self):
        self.term = "Ajgoajh"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        expected = "Can't find anything in Wikipedia for \"%s\"."
        self.assertEqual(out, expected % self.text)
Esempio n. 9
0
    def test_wik(self):
        self.term = "Human back"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        self.keywords = ['human', 'back', 'body', 'buttocks', 'neck']
        self.check_snippet(out)
Esempio n. 10
0
    def test_wik_none(self):
        self.term = "Ajgoajh"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        expected = "Can't find anything in Wikipedia for \"{0}\"."
        self.assertEqual(out, expected.format(self.text))
Esempio n. 11
0
    def test_wik(self):
        self.term = "Human back"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        self.keywords = ['human', 'back', 'body', 'buttocks', 'neck']
        self.check_snippet(out)
Esempio n. 12
0
    def test_wik_fragment(self):
        self.term = "New York City"
        self.section = "Climate"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        self.keywords = ['New York', 'climate', 'humid', 'subtropical']
        self.check_snippet(out)
Esempio n. 13
0
    def test_wik_invalid(self):
        self.term = "New York City"
        self.section = "Physics"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        message = "No '{0}' section found.".format(self.section)
        self.assertEqual(out, '"{0}" - {1}'.format(message, self.url))
Esempio n. 14
0
    def test_wik_fragment(self):
        self.term = "New York City"
        self.section = "Climate"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        self.keywords = ['New York', 'climate', 'humid', 'subtropical']
        self.check_snippet(out)
Esempio n. 15
0
    def test_wik_invalid(self):
        self.term = "New York City"
        self.section = "Physics"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        message = "No '%s' section found." % self.section
        self.assertEqual(out, '"%s" - %s' % (message, self.url))
Esempio n. 16
0
    def test_wik_invalid(self):
        self.term = "New York City"
        self.section = "Physics"
        self.prepare()

        wikipedia.wik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        message = "No '%s' section found." % self.section
        self.assertEqual(out, '"%s" - %s' % (message, self.url))
Esempio n. 17
0
    def test_wik_fragment(self):
        term = "New York City#Climate"
        input = Mock(group=self.makegroup('', term))
        wikipedia.wik(self.phenny, input)

        out = self.phenny.say.call_args[0][0]
        m = re.match(
            '^.* - https:\/\/en\.wikipedia\.org\/wiki\/New_York_City#Climate$',
            out,
            flags=re.UNICODE)
        self.assertTrue(m)