From b2add77d087dc8192d0e55b3bb21a7413169e1fd Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Sat, 11 Feb 2017 19:04:47 +0000 Subject: [PATCH] properly skip vtwiki tests and, enable calc tests (2^64) was disabled --- modules/test/test_calc.py | 4 +-- modules/test/test_vtluugwiki.py | 58 ++++++++++++++++----------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/modules/test/test_calc.py b/modules/test/test_calc.py index 8a63cf1..ad82e59 100644 --- a/modules/test/test_calc.py +++ b/modules/test/test_calc.py @@ -25,12 +25,12 @@ class TestCalc(unittest.TestCase): self.phenny.say.assert_called_once_with('2') - @unittest.skip('Not supported with DuckDuckGo') +# @unittest.skip('Not supported with DuckDuckGo') def test_c_scientific(self): input = Mock(group=lambda x: '2^64') c(self.phenny, input) - self.phenny.say.assert_called_once_with('1.84467441 * 10^(19)') + self.phenny.say.assert_called_once_with('1.84467440737096 * 10^19') def test_c_none(self): input = Mock(group=lambda x: 'aif') diff --git a/modules/test/test_vtluugwiki.py b/modules/test/test_vtluugwiki.py index e2c81e8..efbac00 100644 --- a/modules/test/test_vtluugwiki.py +++ b/modules/test/test_vtluugwiki.py @@ -8,32 +8,32 @@ import unittest from mock import MagicMock, Mock from modules import vtluugwiki -# Disabling tests until wiki is up -#class TestVtluugwiki(unittest.TestCase): -# def setUp(self): -# self.phenny = MagicMock() -# -# def test_vtluug(self): -# input = Mock(groups=lambda: ['', "VT-Wireless"]) -# vtluugwiki.vtluug(self.phenny, input) -# -# out = self.phenny.say.call_args[0][0] -# m = re.match('^.* - https:\/\/vtluug\.org\/wiki\/VT-Wireless$', -# out, flags=re.UNICODE) -# self.assertTrue(m) -# -# def test_vtluug_invalid(self): -# term = "EAP-TLS#netcfg" -# input = Mock(groups=lambda: ['', term]) -# vtluugwiki.vtluug(self.phenny, input) -# -# self.phenny.say.assert_called_once_with( "Can't find anything in "\ -# "the VTLUUG Wiki for \"{0}\".".format(term)) -# -# def test_vtluug_none(self): -# term = "Ajgoajh" -# input = Mock(groups=lambda: ['', term]) -# vtluugwiki.vtluug(self.phenny, input) -# -# self.phenny.say.assert_called_once_with( "Can't find anything in "\ -# "the VTLUUG Wiki for \"{0}\".".format(term)) +@unittest.skip('Skipping until wiki is back up') +class TestVtluugwiki(unittest.TestCase): + def setUp(self): + self.phenny = MagicMock() + + def test_vtluug(self): + input = Mock(groups=lambda: ['', "VT-Wireless"]) + vtluugwiki.vtluug(self.phenny, input) + + out = self.phenny.say.call_args[0][0] + m = re.match('^.* - https:\/\/vtluug\.org\/wiki\/VT-Wireless$', + out, flags=re.UNICODE) + self.assertTrue(m) + + def test_vtluug_invalid(self): + term = "EAP-TLS#netcfg" + input = Mock(groups=lambda: ['', term]) + vtluugwiki.vtluug(self.phenny, input) + + self.phenny.say.assert_called_once_with( "Can't find anything in "\ + "the VTLUUG Wiki for \"{0}\".".format(term)) + + def test_vtluug_none(self): + term = "Ajgoajh" + input = Mock(groups=lambda: ['', term]) + vtluugwiki.vtluug(self.phenny, input) + + self.phenny.say.assert_called_once_with( "Can't find anything in "\ + "the VTLUUG Wiki for \"{0}\".".format(term))