@@ -358,3 +358,33 @@ def test_ticket_json(self):
358358 'update 3' : 'By emp1 (Employee) employee says something' }
359359 self .assert_no_fail (result )
360360 self .assertEqual (json .loads (result .output ), expected )
361+
362+ def test_list_limit (self ):
363+ result = self .run_command (['ticket' , 'list' , '--limit' , '1' ])
364+
365+ expected = [{
366+ 'assigned_user' : 'John Smith' ,
367+ 'Case_Number' : 'CS123456' ,
368+ 'id' : 102 ,
369+ 'last_edited' : '2013-08-01' ,
370+ 'priority' : 0 ,
371+ 'status' : 'Open' ,
372+ 'title' : 'Cloud Instance Cancellation - 08/01/13' ,
373+ 'updates' : 0 }]
374+ self .assert_no_fail (result )
375+ self .assertEqual (expected , json .loads (result .output ))
376+
377+ def test_list_all_open (self ):
378+ result = self .run_command (['ticket' , 'list' , '--all' ])
379+
380+ expected = [{
381+ 'assigned_user' : 'John Smith' ,
382+ 'Case_Number' : 'CS123456' ,
383+ 'id' : 102 ,
384+ 'last_edited' : '2013-08-01' ,
385+ 'priority' : 0 ,
386+ 'status' : 'Open' ,
387+ 'title' : 'Cloud Instance Cancellation - 08/01/13' ,
388+ 'updates' : 0 }]
389+ self .assert_no_fail (result )
390+ self .assertEqual (expected , json .loads (result .output ))
0 commit comments