File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?xml version =' 1.0' encoding =' UTF-8' ?>
2+ <tsResponse
3+ xmlns =" http://tableau.com/api"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_20.xsd" >
5+ <tasks >
6+ <task >
7+ <extractRefresh id =" 12b07582-7c8b-4f1b-318b-51f6e58e4517" priority =" 50" consecutiveFailedCount =" 0" type =" RefreshExtractTask" >
8+ <schedule frequency =" Daily" nextRunAt =" 2024-02-21T02:20:00Z" >
9+ <frequencyDetails start =" 18:20:00" end =" 18:20:00" >
10+ <intervals >
11+ <interval hours =" 24" />
12+ <interval weekDay =" Tuesday" />
13+ </intervals >
14+ </frequencyDetails >
15+ </schedule >
16+ <datasource id =" e4de0575-fcc7-4232-5659-be09bb8e7654" />
17+ </extractRefresh >
18+ </task >
19+ </tasks >
20+ </tsResponse >
Original file line number Diff line number Diff line change 1919GET_XML_RUN_NOW_RESPONSE = os .path .join (TEST_ASSET_DIR , "tasks_run_now_response.xml" )
2020GET_XML_CREATE_TASK_RESPONSE = os .path .join (TEST_ASSET_DIR , "tasks_create_extract_task.xml" )
2121GET_XML_WITHOUT_SCHEDULE = TEST_ASSET_DIR / "tasks_without_schedule.xml"
22+ GET_XML_WITH_INTERVAL = TEST_ASSET_DIR / "tasks_with_interval.xml"
2223
2324
2425class TaskTests (unittest .TestCase ):
@@ -97,6 +98,15 @@ def test_get_task_without_schedule(self):
9798 self .assertEqual ("c7a9327e-1cda-4504-b026-ddb43b976d1d" , task .target .id )
9899 self .assertEqual ("datasource" , task .target .type )
99100
101+ def test_get_task_with_interval (self ):
102+ with requests_mock .mock () as m :
103+ m .get (self .baseurl , text = GET_XML_WITH_INTERVAL .read_text ())
104+ all_tasks , pagination_item = self .server .tasks .get ()
105+
106+ task = all_tasks [0 ]
107+ self .assertEqual ("e4de0575-fcc7-4232-5659-be09bb8e7654" , task .target .id )
108+ self .assertEqual ("datasource" , task .target .type )
109+
100110 def test_delete (self ):
101111 with requests_mock .mock () as m :
102112 m .delete (self .baseurl + "/c7a9327e-1cda-4504-b026-ddb43b976d1d" , status_code = 204 )
You can’t perform that action at this time.
0 commit comments