@@ -31,7 +31,7 @@ class HTTPBackend(object):
3131
3232 @FIXME: Build in support for supplying arbitrary backends
3333 """
34- def __init__ (self ,api_key ,as_xml = False ,resource_name = None ,timeout = None ):
34+ def __init__ (self ,api_key ,as_xml = False ,resource_name = None ,timeout = None , test = False ):
3535"""
3636 Creates an HTTPBackend object, which abstracts out some of the
3737 library specific HTTP stuff.
@@ -44,6 +44,7 @@ def __init__(self, api_key, as_xml=False, resource_name=None, timeout=None):
4444self .http = httplib2 .Http (timeout = timeout )
4545self .as_xml = as_xml
4646self .api_key = api_key
47+ self .test = test
4748
4849if self .as_xml :
4950self .headers = {'Content-Type' :'application/xml' ,
@@ -123,7 +124,7 @@ def process(self, http_response, content):
123124
124125class Zencoder (object ):
125126""" This is the entry point to the Zencoder API """
126- def __init__ (self ,api_key = None ,as_xml = False ,timeout = None ):
127+ def __init__ (self ,api_key = None ,as_xml = False ,timeout = None , test = False ):
127128"""
128129 Initializes Zencoder. You must have a valid API_KEY.
129130
@@ -142,8 +143,9 @@ def __init__(self, api_key=None, as_xml=False, timeout=None):
142143else :
143144self .api_key = api_key
144145
146+ self .test = test
145147self .as_xml = as_xml
146- self .job = Job (self .api_key ,self .as_xml ,timeout = timeout )
148+ self .job = Job (self .api_key ,self .as_xml ,timeout = timeout , test = self . test )
147149self .account = Account (self .api_key ,self .as_xml ,timeout = timeout )
148150self .output = Output (self .api_key ,self .as_xml ,timeout = timeout )
149151
@@ -221,11 +223,11 @@ class Job(HTTPBackend):
221223"""
222224 Contains all API methods relating to transcoding Jobs.
223225 """
224- def __init__ (self ,api_key ,as_xml = False ,timeout = None ):
226+ def __init__ (self ,api_key ,as_xml = False ,timeout = None , test = False ):
225227"""
226228 Initialize a job object
227229 """
228- super (Job ,self ).__init__ (api_key ,as_xml ,'jobs' ,timeout = timeout )
230+ super (Job ,self ).__init__ (api_key ,as_xml ,'jobs' ,timeout = timeout , test = test )
229231
230232def create (self ,input ,outputs = None ,options = None ):
231233"""
@@ -235,7 +237,9 @@ def create(self, input, outputs=None, options=None):
235237 @param outputs: a list of output dictionaries
236238 @param options: a dictionary of job options
237239 """
238- data = {"api_key" :self .api_key ,"input" :input }
240+ as_test = int (self .test )
241+
242+ data = {"api_key" :self .api_key ,"input" :input ,"test" :as_test }
239243if outputs :
240244data ['outputs' ]= outputs
241245