|
27 | 27 | POPULATE_VIEWS_USAGE_XML = os.path.join(TEST_ASSET_DIR, 'workbook_populate_views_usage.xml') |
28 | 28 | PUBLISH_XML = os.path.join(TEST_ASSET_DIR, 'workbook_publish.xml') |
29 | 29 | PUBLISH_ASYNC_XML = os.path.join(TEST_ASSET_DIR, 'workbook_publish_async.xml') |
| 30 | +REFRESH_XML = os.path.join(TEST_ASSET_DIR, 'workbook_refresh.xml') |
30 | 31 | UPDATE_XML = os.path.join(TEST_ASSET_DIR, 'workbook_update.xml') |
31 | 32 | UPDATE_PERMISSIONS = os.path.join(TEST_ASSET_DIR, 'workbook_update_permissions.xml') |
32 | 33 |
|
@@ -114,6 +115,28 @@ def test_get_by_id(self): |
114 | 115 | def test_get_by_id_missing_id(self): |
115 | 116 | self.assertRaises(ValueError, self.server.workbooks.get_by_id, '') |
116 | 117 |
|
| 118 | + def test_refresh_id(self): |
| 119 | + self.server.version = '2.8' |
| 120 | + self.baseurl = self.server.workbooks.baseurl |
| 121 | + with open(REFRESH_XML, 'rb') as f: |
| 122 | + response_xml = f.read().decode('utf-8') |
| 123 | + with requests_mock.mock() as m: |
| 124 | + m.post(self.baseurl + '/3cc6cd06-89ce-4fdc-b935-5294135d6d42/refresh', |
| 125 | + status_code=202, text=response_xml) |
| 126 | + self.server.workbooks.refresh('3cc6cd06-89ce-4fdc-b935-5294135d6d42') |
| 127 | + |
| 128 | + def test_refresh_object(self): |
| 129 | + self.server.version = '2.8' |
| 130 | + self.baseurl = self.server.workbooks.baseurl |
| 131 | + workbook = TSC.WorkbookItem('') |
| 132 | + workbook._id = '3cc6cd06-89ce-4fdc-b935-5294135d6d42' |
| 133 | + with open(REFRESH_XML, 'rb') as f: |
| 134 | + response_xml = f.read().decode('utf-8') |
| 135 | + with requests_mock.mock() as m: |
| 136 | + m.post(self.baseurl + '/3cc6cd06-89ce-4fdc-b935-5294135d6d42/refresh', |
| 137 | + status_code=202, text=response_xml) |
| 138 | + self.server.workbooks.refresh(workbook) |
| 139 | + |
117 | 140 | def test_delete(self): |
118 | 141 | with requests_mock.mock() as m: |
119 | 142 | m.delete(self.baseurl + '/3cc6cd06-89ce-4fdc-b935-5294135d6d42', status_code=204) |
|
0 commit comments