Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from mozilla-services/rfk/test-config-cleanups
Browse files Browse the repository at this point in the history
Rename get_test_configurator() method to get_configurator().
  • Loading branch information
tarekziade committed Apr 18, 2012
2 parents fbdcdad + bb0d400 commit 94d7cff
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mozsvc/tests/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,22 @@ class TestCase(unittest2.TestCase):
"""TestCase with some generic helper methods."""

def setUp(self):
self.config = self.get_test_configurator()
super(TestCase, self).setUp()
self.config = self.get_configurator()

def get_test_configurator(self):
def tearDown(self):
self.config.end()
super(TestCase, self).tearDown()

def get_configurator(self):
"""Load the configurator to use for the tests."""
# Load config from the .ini file.
# The file to use may be specified in the environment.
self.ini_file = os.environ.get("MOZSVC_TEST_INI_FILE", "tests.ini")
__file__ = sys.modules[self.__class__.__module__].__file__
return get_test_configurator(__file__, self.ini_file)
config = get_test_configurator(__file__, self.ini_file)
config.begin()
return config

def make_request(self, *args, **kwds):
return make_request(self.config, *args, **kwds)
Expand Down

0 comments on commit 94d7cff

Please sign in to comment.