Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: third_party/boto/tests/unit/__init__.py

Issue 698893003: Update checked in version of gsutil to version 4.6 (Closed) Base URL: http://dart.googlecode.com/svn/third_party/gsutil/
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/boto/tests/unit/__init__.py
===================================================================
--- third_party/boto/tests/unit/__init__.py (revision 33376)
+++ third_party/boto/tests/unit/__init__.py (working copy)
@@ -4,6 +4,7 @@
import unittest
import httplib
+import mock
from mock import Mock
@@ -77,3 +78,36 @@
def default_body(self):
return ''
+
+
+class MockServiceWithConfigTestCase(AWSMockServiceTestCase):
+ def setUp(self):
+ super(MockServiceWithConfigTestCase, self).setUp()
+ self.environ = {}
+ self.config = {}
+ self.config_patch = mock.patch('boto.provider.config.get',
+ self.get_config)
+ self.has_config_patch = mock.patch('boto.provider.config.has_option',
+ self.has_config)
+ self.environ_patch = mock.patch('os.environ', self.environ)
+ self.config_patch.start()
+ self.has_config_patch.start()
+ self.environ_patch.start()
+
+ def tearDown(self):
+ self.config_patch.stop()
+ self.has_config_patch.stop()
+ self.environ_patch.stop()
+
+ def has_config(self, section_name, key):
+ try:
+ self.config[section_name][key]
+ return True
+ except KeyError:
+ return False
+
+ def get_config(self, section_name, key, default=None):
+ try:
+ return self.config[section_name][key]
+ except KeyError:
+ return None
« no previous file with comments | « third_party/boto/tests/mturk/reviewable_hits.doctest ('k') | third_party/boto/tests/unit/auth/test_sigv4.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698