@@ -54,6 +54,29 @@ def test_get_all_tasks_with_params():
5454 assert isinstance (response .get ('total_count' ), int )
5555 assert len (response .get ('tasks' )) <= 50 and len (response .get ('tasks' )) >= 1
5656
57+ def test_get_all_tasks_with_start_date_and_end_date ():
58+ '''Should return a response when start_date and end_date are passed'''
59+
60+ tasks = ConstructorIO (VALID_OPTIONS ).tasks
61+ response = tasks .get_all_tasks ({ 'start_date' : '2022-09-03' , 'end_date' : '2022-09-30' })
62+
63+ assert isinstance (response .get ('status_counts' ), dict )
64+ assert isinstance (response .get ('tasks' ), list )
65+ assert isinstance (response .get ('total_count' ), int )
66+ assert len (response .get ('tasks' )) <= 50 and len (response .get ('tasks' )) >= 1
67+
68+ def test_get_all_tasks_with_status ():
69+ '''Should return a response when status is passed'''
70+
71+ tasks = ConstructorIO (VALID_OPTIONS ).tasks
72+ response = tasks .get_all_tasks ({ 'status' : 'DONE' })
73+
74+ assert isinstance (response .get ('status_counts' ), dict )
75+ assert isinstance (response .get ('tasks' ), list )
76+ assert isinstance (response .get ('total_count' ), int )
77+ assert response .get ('tasks' )[0 ].get ('status' ) == 'DONE'
78+ assert len (response .get ('tasks' )) <= 50 and len (response .get ('tasks' )) >= 1
79+
5780def test_get_all_tasks_with_invalid_api_key ():
5881 '''Should raise exception when invalid api_key is provided'''
5982
0 commit comments