File: mocks.py

package info (click to toggle)
python-boto 2.49.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,888 kB
  • sloc: python: 86,396; makefile: 112
file content (11 lines) | stat: -rw-r--r-- 430 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
from boto.mturk.connection import MTurkConnection as RealMTurkConnection

class MTurkConnection(RealMTurkConnection):
	"""
	Mock MTurkConnection that doesn't connect, but instead just prepares
	the request and captures information about its usage.
	"""
	
	def _process_request(self, *args, **kwargs):
		saved_args = self.__dict__.setdefault('_mock_saved_args', dict())
		saved_args['_process_request'] = (args, kwargs)