From f820c6dcb33972b768f247d8f58f021c54bb1422 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Fri, 1 Jun 2012 00:13:57 -0700 Subject: [PATCH] split out path adjustments into __init__ --- modules/test/__init__.py | 3 +++ modules/test/test_fcc.py | 5 +---- modules/test/test_hs.py | 5 +---- modules/test/test_imdb.py | 5 +---- modules/test/test_mylife.py | 5 +---- modules/test/test_short.py | 5 +---- modules/test/test_slogan.py | 5 +---- modules/test/test_tfw.py | 5 +---- modules/test/test_urbandict.py | 5 +---- test/__init__.py | 3 +++ test/test_bot.py | 5 ----- test/test_irc.py | 5 ----- 12 files changed, 14 insertions(+), 42 deletions(-) create mode 100644 test/__init__.py diff --git a/modules/test/__init__.py b/modules/test/__init__.py index e69de29..c1f6ddb 100644 --- a/modules/test/__init__.py +++ b/modules/test/__init__.py @@ -0,0 +1,3 @@ +# add current working directory to path +import sys +sys.path.append('.') diff --git a/modules/test/test_fcc.py b/modules/test/test_fcc.py index e669257..0086cd9 100644 --- a/modules/test/test_fcc.py +++ b/modules/test/test_fcc.py @@ -3,14 +3,11 @@ test_fcc.py - tests for the fcc callsign lookup module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import unittest from mock import MagicMock, Mock from modules.fcc import fcc + class TestFcc(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_hs.py b/modules/test/test_hs.py index 980b954..e15631e 100644 --- a/modules/test/test_hs.py +++ b/modules/test/test_hs.py @@ -3,15 +3,12 @@ test_hs.py - tests for the hokie stalker module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import re import unittest from mock import MagicMock, Mock from modules.hs import search, hs + class TestHs(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_imdb.py b/modules/test/test_imdb.py index 9e4279b..f1a1ff3 100644 --- a/modules/test/test_imdb.py +++ b/modules/test/test_imdb.py @@ -3,15 +3,12 @@ test_imdb.py - tests for the imdb module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import re import unittest from mock import MagicMock, Mock from modules.imdb import imdb_search, imdb + class TestImdb(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_mylife.py b/modules/test/test_mylife.py index a271faa..5a45f90 100644 --- a/modules/test/test_mylife.py +++ b/modules/test/test_mylife.py @@ -3,14 +3,11 @@ test_mylife.py - tests for the mylife module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import unittest from mock import MagicMock, Mock from modules import mylife + class TestMylife(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_short.py b/modules/test/test_short.py index 3a16432..b899d5f 100644 --- a/modules/test/test_short.py +++ b/modules/test/test_short.py @@ -3,14 +3,11 @@ test_short.py - tests for the vtluug url shortener module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import unittest from mock import MagicMock, Mock from modules.short import short + class TestShort(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_slogan.py b/modules/test/test_slogan.py index fbdc727..6ec92ef 100644 --- a/modules/test/test_slogan.py +++ b/modules/test/test_slogan.py @@ -3,14 +3,11 @@ test_slogan.py - tests for the slogan module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import unittest from mock import MagicMock, Mock from modules.slogan import sloganize, slogan + class TestSlogan(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_tfw.py b/modules/test/test_tfw.py index 0973bc6..034fb9a 100644 --- a/modules/test/test_tfw.py +++ b/modules/test/test_tfw.py @@ -3,15 +3,12 @@ test_tfw.py - tests for the fucking weather module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import re import unittest from mock import MagicMock, Mock from modules.tfw import tfw + class TestTfw(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/modules/test/test_urbandict.py b/modules/test/test_urbandict.py index 28bd592..ea4d542 100644 --- a/modules/test/test_urbandict.py +++ b/modules/test/test_urbandict.py @@ -3,15 +3,12 @@ test_urbandict.py - tests for the urban dictionary module author: mutantmonkey """ -# add current working directory to path -import sys -sys.path.append('.') - import re import unittest from mock import MagicMock, Mock from modules.urbandict import urbandict + class TestUrbandict(unittest.TestCase): def setUp(self): self.phenny = MagicMock() diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..c1f6ddb --- /dev/null +++ b/test/__init__.py @@ -0,0 +1,3 @@ +# add current working directory to path +import sys +sys.path.append('.') diff --git a/test/test_bot.py b/test/test_bot.py index b12a95d..3b67dbe 100644 --- a/test/test_bot.py +++ b/test/test_bot.py @@ -2,13 +2,8 @@ Tests for phenny's bot.py """ -# add current working directory to path -import sys -sys.path.append('.') - import unittest from mock import call, patch, Mock - import bot diff --git a/test/test_irc.py b/test/test_irc.py index 49ab0d6..8665d0c 100644 --- a/test/test_irc.py +++ b/test/test_irc.py @@ -2,13 +2,8 @@ Tests for phenny's irc.py """ -# add current working directory to path -import sys -sys.path.append('.') - import unittest from mock import call, patch, Mock - import irc