File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -265,15 +265,17 @@ def get(self, transmission_id):
265265 results = self ._fetch_get (transmission_id )
266266 return results ['transmission' ]
267267
268- def list (self ):
268+ def list (self , ** kwargs ):
269269 """
270270 Get a list of your transmissions
271271
272+ :param campaign_id: ID of the campaign used by the transmissions
273+ :param template_id: ID of the template used by the transmissions
274+
272275 :returns: list of transmissions
273276 :raises: :exc:`SparkPostAPIException` if API call fails
274277 """
275- results = self .request ('GET' , self .uri )
276- return results
278+ return self .request ('GET' , self .uri , params = kwargs )
277279
278280 def delete (self , transmission_id ):
279281 """
Original file line number Diff line number Diff line change @@ -310,6 +310,22 @@ def test_success_list():
310310 assert response == []
311311
312312
313+ @responses .activate
314+ def test_success_list_with_params ():
315+ responses .add (
316+ responses .GET ,
317+ 'https://api.sparkpost.com/api/v1/transmissions?template_id=abcd' ,
318+ status = 200 ,
319+ content_type = 'application/json' ,
320+ body = '{"results": []}' ,
321+ match_querystring = True
322+
323+ )
324+ sp = SparkPost ('fake-key' )
325+ response = sp .transmission .list (template_id = 'abcd' )
326+ assert response == []
327+
328+
313329@responses .activate
314330def test_success_delete ():
315331 responses .add (
You can’t perform that action at this time.
0 commit comments