Exemplo n.º 1
0
    def test_awik_invalid(self):
        term = "KVM#Enabling_KSM"
        input = Mock(groups=lambda: ['', term])
        archwiki.awik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "the ArchWiki for \"{0}\".".format(term))
Exemplo n.º 2
0
    def test_awik_none(self):
        term = "Ajgoajh"
        input = Mock(groups=lambda: ['', term])
        archwiki.awik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "the ArchWiki for \"{0}\".".format(term))
Exemplo n.º 3
0
    def test_awik_none(self):
        term = "Ajgoajh"
        input = Mock(groups=lambda: ['', term])
        archwiki.awik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "the ArchWiki for \"{0}\".".format(term))
Exemplo n.º 4
0
    def test_awik_invalid(self):
        term = "KVM#Enabling_KSM"
        input = Mock(groups=lambda: ['', term])
        archwiki.awik(self.phenny, input)

        self.phenny.say.assert_called_once_with( "Can't find anything in "\
                "the ArchWiki for \"{0}\".".format(term))
Exemplo n.º 5
0
    def test_awik(self):
        input = Mock(groups=lambda: ['', "KVM"])
        archwiki.awik(self.phenny, input)

        out = self.phenny.say.call_args[0][0]
        m = re.match('^.* - https:\/\/wiki\.archlinux\.org\/index\.php\/KVM$',
                out, flags=re.UNICODE)
        self.assertTrue(m)
Exemplo n.º 6
0
    def test_awik_none(self):
        self.term = "Ajgoajh"
        self.prepare()

        archwiki.awik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        expected = "Can't find anything in the ArchWiki for \"{0}\"."
        self.assertEqual(out, expected.format(self.text))
Exemplo n.º 7
0
    def test_awik(self):
        self.term = "OpenDMARC"
        self.prepare()

        archwiki.awik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        self.keywords = ['DMARC', 'implementation', 'specification']
        self.check_snippet(out)
Exemplo n.º 8
0
    def test_awik(self):
        input = Mock(groups=lambda: ['', "KVM"])
        archwiki.awik(self.phenny, input)

        out = self.phenny.say.call_args[0][0]
        m = re.match('^.* - https:\/\/wiki\.archlinux\.org\/index\.php\/KVM$',
                     out,
                     flags=re.UNICODE)
        self.assertTrue(m)
Exemplo n.º 9
0
    def test_awik_invalid(self):
        self.term = "KVM"
        self.section = "Enabling KSM"
        self.prepare()

        archwiki.awik(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))
Exemplo n.º 10
0
    def test_awik_fragment(self):
        self.term = "KVM"
        self.section = "Kernel support"
        self.prepare()

        archwiki.awik(self.phenny, self.input)
        out = self.phenny.say.call_args[0][0]

        self.keywords = ['kernel', 'modules', 'KVM', 'VIRTIO']
        self.check_snippet(out)
Exemplo n.º 11
0
    def test_awik_invalid(self):
        self.term = "KVM"
        self.section = "Enabling KSM"
        self.prepare()

        archwiki.awik(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))
Exemplo n.º 12
0
 def test_awik_none(self):
     term = "Ajgoajh"
     self.input.groups.return_value = ['', term]
     archwiki.awik(self.phenny, self.input)
     self.phenny.say.assert_called_once_with( "Can't find anything in "\
             "the ArchWiki for \"{0}\".".format(term))
Exemplo n.º 13
0
 def test_awik(self):
     self.input.groups.return_value = ['', "KVM"]
     archwiki.awik(self.phenny, self.input)
     out = self.phenny.say.call_args[0][0]
     self.assertIn('https://wiki.archlinux.org/index.php/KVM', out)