diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-01-15 13:51:13 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-01-15 13:51:13 +0000 |
| commit | e82dd24d96189786ffdf475f8c26494ef3e7f0f5 (patch) | |
| tree | 2e16debfec0a991f858199ff8b2d099edf68c044 | |
| parent | 8bdfb30e4732925fc1d015607fe70b2705fb90d6 (diff) | |
| download | pyramid-e82dd24d96189786ffdf475f8c26494ef3e7f0f5.tar.gz pyramid-e82dd24d96189786ffdf475f8c26494ef3e7f0f5.tar.bz2 pyramid-e82dd24d96189786ffdf475f8c26494ef3e7f0f5.zip | |
Get rid of _getFUT.
| -rw-r--r-- | repoze/bfg/tests/test_settings.py | 72 |
1 files changed, 33 insertions, 39 deletions
diff --git a/repoze/bfg/tests/test_settings.py b/repoze/bfg/tests/test_settings.py index 1d1eb08ea..8c1fe2c39 100644 --- a/repoze/bfg/tests/test_settings.py +++ b/repoze/bfg/tests/test_settings.py @@ -24,98 +24,92 @@ class TestSettings(unittest.TestCase): self.assertEqual(settings.unicode_path_segments, True) class TestGetOptions(unittest.TestCase): - def _getFUT(self): + def _callFUT(self, *arg, **kw): from repoze.bfg.settings import get_options - return get_options + return get_options(*arg, **kw) def test_reload_templates(self): - get_options = self._getFUT() - result = get_options({}) + result = self._callFUT({}) self.assertEqual(result['reload_templates'], False) - result = get_options({'reload_templates':'false'}) + result = self._callFUT({'reload_templates':'false'}) self.assertEqual(result['reload_templates'], False) - result = get_options({'reload_templates':'t'}) + result = self._callFUT({'reload_templates':'t'}) self.assertEqual(result['reload_templates'], True) - result = get_options({'reload_templates':'1'}) + result = self._callFUT({'reload_templates':'1'}) self.assertEqual(result['reload_templates'], True) - result = get_options({}, {'BFG_RELOAD_TEMPLATES':'1'}) + result = self._callFUT({}, {'BFG_RELOAD_TEMPLATES':'1'}) self.assertEqual(result['reload_templates'], True) - result = get_options({'reload_templates':'false'}, + result = self._callFUT({'reload_templates':'false'}, {'BFG_RELOAD_TEMPLATES':'1'}) self.assertEqual(result['reload_templates'], True) def test_debug_authorization(self): - get_options = self._getFUT() - result = get_options({}) + result = self._callFUT({}) self.assertEqual(result['debug_authorization'], False) - result = get_options({'debug_authorization':'false'}) + result = self._callFUT({'debug_authorization':'false'}) self.assertEqual(result['debug_authorization'], False) - result = get_options({'debug_authorization':'t'}) + result = self._callFUT({'debug_authorization':'t'}) self.assertEqual(result['debug_authorization'], True) - result = get_options({'debug_authorization':'1'}) + result = self._callFUT({'debug_authorization':'1'}) self.assertEqual(result['debug_authorization'], True) - result = get_options({}, {'BFG_DEBUG_AUTHORIZATION':'1'}) + result = self._callFUT({}, {'BFG_DEBUG_AUTHORIZATION':'1'}) self.assertEqual(result['debug_authorization'], True) - result = get_options({'debug_authorization':'false'}, + result = self._callFUT({'debug_authorization':'false'}, {'BFG_DEBUG_AUTHORIZATION':'1'}) self.assertEqual(result['debug_authorization'], True) def test_debug_notfound(self): - get_options = self._getFUT() - result = get_options({}) + result = self._callFUT({}) self.assertEqual(result['debug_notfound'], False) - result = get_options({'debug_notfound':'false'}) + result = self._callFUT({'debug_notfound':'false'}) self.assertEqual(result['debug_notfound'], False) - result = get_options({'debug_notfound':'t'}) + result = self._callFUT({'debug_notfound':'t'}) self.assertEqual(result['debug_notfound'], True) - result = get_options({'debug_notfound':'1'}) + result = self._callFUT({'debug_notfound':'1'}) self.assertEqual(result['debug_notfound'], True) - result = get_options({}, {'BFG_DEBUG_NOTFOUND':'1'}) + result = self._callFUT({}, {'BFG_DEBUG_NOTFOUND':'1'}) self.assertEqual(result['debug_notfound'], True) - result = get_options({'debug_notfound':'false'}, + result = self._callFUT({'debug_notfound':'false'}, {'BFG_DEBUG_NOTFOUND':'1'}) self.assertEqual(result['debug_notfound'], True) def test_debug_all(self): - get_options = self._getFUT() - result = get_options({}) + result = self._callFUT({}) self.assertEqual(result['debug_notfound'], False) self.assertEqual(result['debug_authorization'], False) - result = get_options({'debug_all':'false'}) + result = self._callFUT({'debug_all':'false'}) self.assertEqual(result['debug_notfound'], False) self.assertEqual(result['debug_authorization'], False) - result = get_options({'debug_all':'t'}) + result = self._callFUT({'debug_all':'t'}) self.assertEqual(result['debug_notfound'], True) self.assertEqual(result['debug_authorization'], True) - result = get_options({'debug_all':'1'}) + result = self._callFUT({'debug_all':'1'}) self.assertEqual(result['debug_notfound'], True) self.assertEqual(result['debug_authorization'], True) - result = get_options({}, {'BFG_DEBUG_ALL':'1'}) + result = self._callFUT({}, {'BFG_DEBUG_ALL':'1'}) self.assertEqual(result['debug_notfound'], True) self.assertEqual(result['debug_authorization'], True) - result = get_options({'debug_all':'false'}, + result = self._callFUT({'debug_all':'false'}, {'BFG_DEBUG_ALL':'1'}) self.assertEqual(result['debug_notfound'], True) self.assertEqual(result['debug_authorization'], True) def test_unicode_path_segments(self): - get_options = self._getFUT() - result = get_options({}) + result = self._callFUT({}) self.assertEqual(result['unicode_path_segments'], True) - result = get_options({'unicode_path_segments':'false'}) + result = self._callFUT({'unicode_path_segments':'false'}) self.assertEqual(result['unicode_path_segments'], False) - result = get_options({'unicode_path_segments':'t'}) + result = self._callFUT({'unicode_path_segments':'t'}) self.assertEqual(result['unicode_path_segments'], True) - result = get_options({'unicode_path_segments':'1'}) + result = self._callFUT({'unicode_path_segments':'1'}) self.assertEqual(result['unicode_path_segments'], True) - result = get_options({}, {'BFG_UNICODE_PATH_SEGMENTS':'1'}) + result = self._callFUT({}, {'BFG_UNICODE_PATH_SEGMENTS':'1'}) self.assertEqual(result['unicode_path_segments'], True) - result = get_options({'unicode_path_segments':'false'}, + result = self._callFUT({'unicode_path_segments':'false'}, {'BFG_UNICODE_PATH_SEGMENTS':'1'}) self.assertEqual(result['unicode_path_segments'], True) def test_originals_kept(self): - get_options = self._getFUT() - result = get_options({'a':'i am so a'}) + result = self._callFUT({'a':'i am so a'}) self.assertEqual(result['a'], 'i am so a') |
