smartsheet-python-sdk 3.5.3__py2.py3-none-any.whl → 3.5.4__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- smartsheet/version.py +2 -2
- {smartsheet_python_sdk-3.5.3.dist-info → smartsheet_python_sdk-3.5.4.dist-info}/METADATA +1 -1
- {smartsheet_python_sdk-3.5.3.dist-info → smartsheet_python_sdk-3.5.4.dist-info}/RECORD +7 -55
- {smartsheet_python_sdk-3.5.3.dist-info → smartsheet_python_sdk-3.5.4.dist-info}/top_level.txt +0 -1
- tests/__init__.py +0 -0
- tests/integration/README.md +0 -37
- tests/integration/conftest.py +0 -174
- tests/integration/fixtures/calling_all_curs.txt +0 -1
- tests/integration/fixtures/curly.jpg +0 -0
- tests/integration/fixtures/moe-curly.jpg +0 -0
- tests/integration/fixtures/quote.txt +0 -1
- tests/integration/fixtures/stooges_v1.jpg +0 -0
- tests/integration/fixtures/stooges_v2.jpg +0 -0
- tests/integration/test_attachments.py +0 -99
- tests/integration/test_columns.py +0 -91
- tests/integration/test_contacts.py +0 -27
- tests/integration/test_cross_sheet_references.py +0 -30
- tests/integration/test_discussions.py +0 -195
- tests/integration/test_events.py +0 -56
- tests/integration/test_favorites.py +0 -33
- tests/integration/test_folders.py +0 -130
- tests/integration/test_groups.py +0 -92
- tests/integration/test_home.py +0 -99
- tests/integration/test_model_attributes.py +0 -2848
- tests/integration/test_multi_picklist.py +0 -66
- tests/integration/test_object_value.py +0 -126
- tests/integration/test_passthrough.py +0 -37
- tests/integration/test_regression.py +0 -240
- tests/integration/test_reports.py +0 -134
- tests/integration/test_rows.py +0 -196
- tests/integration/test_server_info.py +0 -10
- tests/integration/test_sharing.py +0 -83
- tests/integration/test_sheet_summary.py +0 -64
- tests/integration/test_sheets.py +0 -384
- tests/integration/test_templates.py +0 -21
- tests/integration/test_update_requests.py +0 -61
- tests/integration/test_users.py +0 -134
- tests/integration/test_webhooks.py +0 -50
- tests/integration/test_workspaces.py +0 -271
- tests/integration/test_zsearch.py +0 -30
- tests/mock_api/__init__.py +0 -0
- tests/mock_api/mock_api_test_helper.py +0 -73
- tests/mock_api/test_mock_api_automation_rules.py +0 -39
- tests/mock_api/test_mock_api_columns.py +0 -48
- tests/mock_api/test_mock_api_folders.py +0 -184
- tests/mock_api/test_mock_api_rows.py +0 -715
- tests/mock_api/test_mock_api_sharing.py +0 -511
- tests/mock_api/test_mock_api_sheets.py +0 -42
- tests/mock_api/test_mock_api_sights.py +0 -58
- tests/mock_api/test_mock_api_workspaces.py +0 -241
- tests/mock_api/test_mock_change_agent.py +0 -26
- tests/mock_api/test_mock_serialization.py +0 -559
- {smartsheet_python_sdk-3.5.3.dist-info → smartsheet_python_sdk-3.5.4.dist-info}/WHEEL +0 -0
- {smartsheet_python_sdk-3.5.3.dist-info → smartsheet_python_sdk-3.5.4.dist-info}/licenses/LICENSE.md +0 -0
- {smartsheet_python_sdk-3.5.3.dist-info → smartsheet_python_sdk-3.5.4.dist-info}/licenses/NOTICE +0 -0
smartsheet/version.py
CHANGED
|
@@ -25,7 +25,7 @@ smartsheet/token.py,sha256=5uz-IG5adx_zr2-uepH-W8ATv0dq9aZNjYLeZNwldqI,4703
|
|
|
25
25
|
smartsheet/types.py,sha256=aIdRJ89jwclmiZ4RH3hnZHJTFWFxgNKW3d8fghm21eM,9126
|
|
26
26
|
smartsheet/users.py,sha256=1KnqKJIzJEPMNy26BQY1b9jb3dItbzglrljV1MGD5ic,15887
|
|
27
27
|
smartsheet/util.py,sha256=12Y6eluecB8k4Ns-at81AEM18ND2TCKa9bF4BlNRrKM,5633
|
|
28
|
-
smartsheet/version.py,sha256=
|
|
28
|
+
smartsheet/version.py,sha256=Q-oBfvZWrWFX-8jA5kX5-ds0o8av3Q3YcwJYvLxKEb0,160
|
|
29
29
|
smartsheet/webhooks.py,sha256=7F7g4Ks0GyS3QxsNWm1SFtrOr00jBisCjj7-hcToHM8,4637
|
|
30
30
|
smartsheet/workspaces.py,sha256=r81xh3HfYsX--ll5pQ-h7kSSJELokYV-bSjuD0WloeU,22651
|
|
31
31
|
smartsheet/models/__init__.py,sha256=wJter68K1D2T3Noq4r7SooPhahtdkJBKIrrUwJxymNQ,4860
|
|
@@ -187,57 +187,9 @@ smartsheet/models/enums/system_column_type.py,sha256=UfhNUBGD_0K1Pas7fujGEuax55O
|
|
|
187
187
|
smartsheet/models/enums/update_request_status.py,sha256=xYF84x1dTFhJMYVi1q3G1T9u1IGN3szlR1jj5HHC0hE,777
|
|
188
188
|
smartsheet/models/enums/user_status.py,sha256=SB7qRcA0dhdRimsOKHCGF3CB6fL0XuifxQEWZGNNS8Q,766
|
|
189
189
|
smartsheet/models/enums/widget_type.py,sha256=VfVq59fLZsT4ks_ZBrtv52u2Cl60iAdlA6mGD_elz-k,1072
|
|
190
|
-
smartsheet_python_sdk-3.5.
|
|
191
|
-
smartsheet_python_sdk-3.5.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
tests/integration/test_columns.py,sha256=noHTyMKjq8vMIgkh033YQEkXiY52nxAmp-Mto36Jv4E,2951
|
|
197
|
-
tests/integration/test_contacts.py,sha256=uN3qSeuhId0x5MinvsKXgRyPaDHL1NLH7CccXWtZ4FY,910
|
|
198
|
-
tests/integration/test_cross_sheet_references.py,sha256=RqiTayGNlIXLqNT3OQbk3zcCcX4HlLnKwTJbSDNb_OE,1330
|
|
199
|
-
tests/integration/test_discussions.py,sha256=9ltns9SN73be0WVGi38PCLzwKLX5qxmbHP7mmDgBiEg,7370
|
|
200
|
-
tests/integration/test_events.py,sha256=pMMoywNP1xDiGkCJm0ImM2p2jYN0buB6PLP4R4xP_7c,2582
|
|
201
|
-
tests/integration/test_favorites.py,sha256=NhoqXhcZu2vNkXex3ZaSXSPOdMPx-AyMztu3_6NUjcM,1130
|
|
202
|
-
tests/integration/test_folders.py,sha256=2ZoMCerrIkx9IGd7izhDORDy2RjeGyGenFkGZrLzZlY,5200
|
|
203
|
-
tests/integration/test_groups.py,sha256=vWwreXgiuxlOolD0MgNKHn2ANTH3avuLH7U6xZlkvUQ,2846
|
|
204
|
-
tests/integration/test_home.py,sha256=a95auUi1rggg2oS6dXxyL5GgEr0VvYfv9RrmM0NbDpk,3449
|
|
205
|
-
tests/integration/test_model_attributes.py,sha256=vcF89w8E6x3Ir5WnUqNwyM6Zp2wDFfkEm1ZOkHdnxlE,100219
|
|
206
|
-
tests/integration/test_multi_picklist.py,sha256=xHlbxtpmk_vTwisJ57M6U3bMeQtnea2KVC5YwO48SXs,2537
|
|
207
|
-
tests/integration/test_object_value.py,sha256=mCmFwGoN0t3D8wXiZ63dzlPDPciWtSUDNVUYhpBFEBc,4224
|
|
208
|
-
tests/integration/test_passthrough.py,sha256=vRg9OTBb-y7u5p25fjYnQSKGbSZcanSzReesaVqwYEc,1603
|
|
209
|
-
tests/integration/test_regression.py,sha256=KOMP6vqAVFrN_UCAKD90V3s0eGpWSsUxxphHRFBOAFs,8208
|
|
210
|
-
tests/integration/test_reports.py,sha256=37iTenbbnCP0p2I9UzbQoWwjF4eFFGrBRlSnop0N1FQ,4712
|
|
211
|
-
tests/integration/test_rows.py,sha256=MNzLZOHSBZGWslC8peuD9p_dQ9Jj_V3QHN6C16u4BJY,7596
|
|
212
|
-
tests/integration/test_server_info.py,sha256=atoRjGEFwbja51wyui_5-CeiK27-xLTvQXl4-nUA810,268
|
|
213
|
-
tests/integration/test_sharing.py,sha256=XuMCybgDyZaudEiomOV-XbP-kLY8lY4xfp7Uc-gYREY,2694
|
|
214
|
-
tests/integration/test_sheet_summary.py,sha256=siRtHTZVLaCV3dDrcpApXHLSWmnpncQdMm7OTlk_f6s,3357
|
|
215
|
-
tests/integration/test_sheets.py,sha256=hL5C_hs8y2FyoGBaKcQDsll2RCQeqdFQoGGcDc9BFyQ,14531
|
|
216
|
-
tests/integration/test_templates.py,sha256=vbgxkPkO0DzZ4AfA5wecUKYLQ7Dm_Qux7HB7TxQmWvQ,799
|
|
217
|
-
tests/integration/test_update_requests.py,sha256=Qx-jRLCbTnoJG48J98OzB7g8f8IRmNISiqQNwsArZo4,2726
|
|
218
|
-
tests/integration/test_users.py,sha256=SLWU0D-QfCAp3ymgBoySq_8svet5L31H7WCH9eBaQ5w,4609
|
|
219
|
-
tests/integration/test_webhooks.py,sha256=5pDyfv3BREscXHk7AUOrLDlvsQIZHvPcW6dvZfVI2Hg,1901
|
|
220
|
-
tests/integration/test_workspaces.py,sha256=Xn7mAi0dOIPHZE7Qnff1K16X1FYTc7CbdYims8NIEus,11202
|
|
221
|
-
tests/integration/test_zsearch.py,sha256=fUCCYO25dfX_aby6VVJVpGWsI_-9c-dO__cnRmcPAfI,1101
|
|
222
|
-
tests/integration/fixtures/calling_all_curs.txt,sha256=w6y8iLcnN7Cr2qzTW85n-Y0piB7TWNCJBzYBeC85gNM,61
|
|
223
|
-
tests/integration/fixtures/curly.jpg,sha256=EAgX6jplNdLuy12xTPR_IUO8aBd4FH0wBojP_j8qnKo,17988
|
|
224
|
-
tests/integration/fixtures/moe-curly.jpg,sha256=GeM6RLaXEaAU92RC7pP6kCoO84VPS72qB3Al2reZ9-4,65440
|
|
225
|
-
tests/integration/fixtures/quote.txt,sha256=mC4gL6QbbtpBUXDJHUV7JJNbe0lZRDehuhi05ejYBKk,20
|
|
226
|
-
tests/integration/fixtures/stooges_v1.jpg,sha256=6_FT9q2QK9yxymbhS5c_e8gx6PQnwXj2Z83X47ZP9hc,90832
|
|
227
|
-
tests/integration/fixtures/stooges_v2.jpg,sha256=MSUu7Uh2rTjlnjXgvQFn4s8hErUD5AqbyO0AzMfntJg,30550
|
|
228
|
-
tests/mock_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
229
|
-
tests/mock_api/mock_api_test_helper.py,sha256=6Kmp0yrA68gOTItiHEhHYhqh3LpGnqV_5O3DNgw2tdY,2191
|
|
230
|
-
tests/mock_api/test_mock_api_automation_rules.py,sha256=tEsSkFRF9frJciXD7y_A3T1QF5NFLb6HUC_34Q4gcDc,1609
|
|
231
|
-
tests/mock_api/test_mock_api_columns.py,sha256=9-jvgluH5hWyNEKgfPIB5nPtW40KjD6Q7GUr-EzcMis,1490
|
|
232
|
-
tests/mock_api/test_mock_api_folders.py,sha256=MUDeVv0rn5vAs6GDtrKfIaap-jBO-syoy5MBb2vYJ0E,6755
|
|
233
|
-
tests/mock_api/test_mock_api_rows.py,sha256=2xNqQsvqnk4T_dsWrmu1BPVhNvTlb_gffClaz_LIbpg,20972
|
|
234
|
-
tests/mock_api/test_mock_api_sharing.py,sha256=Ral8u2_FwRhj5VNF1kpNMFJhK4RxYVwGAkio-dQzGxI,15389
|
|
235
|
-
tests/mock_api/test_mock_api_sheets.py,sha256=61mhb0iUnR8j4_5XTrfI9aQHOGGX3RTc3tGsn8G0V2k,1225
|
|
236
|
-
tests/mock_api/test_mock_api_sights.py,sha256=UazPkjGu2UnT_dRz189v1DMhMBDeTRKtWxux6aYao2k,2203
|
|
237
|
-
tests/mock_api/test_mock_api_workspaces.py,sha256=8QzRrkRoenCCD5tB5crmpGzXNmSP9kLjEUU046DJ1AE,9419
|
|
238
|
-
tests/mock_api/test_mock_change_agent.py,sha256=WDd6MKERhqGQJ3QrTQK5ylXMhZ65o5vnhscBlisFjoM,757
|
|
239
|
-
tests/mock_api/test_mock_serialization.py,sha256=0veKtirhYve8BZL8M3yPuREpw-a8TzYK7tH7aLD7LqQ,18174
|
|
240
|
-
smartsheet_python_sdk-3.5.3.dist-info/METADATA,sha256=qL8NsHj-aPqRXVPhQtUYzWGThg8vLvk1CQgYJVM_qcU,4987
|
|
241
|
-
smartsheet_python_sdk-3.5.3.dist-info/WHEEL,sha256=AeO2BvogYWm3eGaHCvhzmUYt8ia7KfURiHzO_1atlys,109
|
|
242
|
-
smartsheet_python_sdk-3.5.3.dist-info/top_level.txt,sha256=ACM1Ryc7rQRwrJIuN7H4aEMO-wUGjiYQshvRPoiOYT4,17
|
|
243
|
-
smartsheet_python_sdk-3.5.3.dist-info/RECORD,,
|
|
190
|
+
smartsheet_python_sdk-3.5.4.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
191
|
+
smartsheet_python_sdk-3.5.4.dist-info/licenses/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
|
|
192
|
+
smartsheet_python_sdk-3.5.4.dist-info/METADATA,sha256=XFB6uYBzqY69rrNpzoFlnbNyj-NjPqapZe4WzO3SYlE,4987
|
|
193
|
+
smartsheet_python_sdk-3.5.4.dist-info/WHEEL,sha256=AeO2BvogYWm3eGaHCvhzmUYt8ia7KfURiHzO_1atlys,109
|
|
194
|
+
smartsheet_python_sdk-3.5.4.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
|
|
195
|
+
smartsheet_python_sdk-3.5.4.dist-info/RECORD,,
|
tests/__init__.py
DELETED
|
File without changes
|
tests/integration/README.md
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# smartsheet-python-sdk unit tests
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
|
|
5
|
-
From the root directory of this repository:
|
|
6
|
-
|
|
7
|
-
```python
|
|
8
|
-
python setup.py develop
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Running the tests
|
|
12
|
-
|
|
13
|
-
Again, from the root directory of this repository:
|
|
14
|
-
|
|
15
|
-
```python
|
|
16
|
-
python setup.py test
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Requirements
|
|
20
|
-
|
|
21
|
-
Some tests carry requirements. We're testing the real service here, not just using mocks. In order to do that, some configuration is necessary for some tests.
|
|
22
|
-
|
|
23
|
-
The test suite expects these environment variables to be present:
|
|
24
|
-
|
|
25
|
-
```shell
|
|
26
|
-
export SMARTSHEET_ACCESS_TOKEN="SSSSSSSSSSSSSSSSSSSSSSSSSS"
|
|
27
|
-
export LOG_CFG="debug" # optional
|
|
28
|
-
export SMARTSHEET_FIXTURE_USERS='{"admin":{"id":9999999999999999},"larry":{"id":0000000000000000},"curly":{"id":1111111111111111},"moe":{"id":2222222222222222}}'
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Please note:** the user nicknames (admin, larry, curly, moe) are not essential. However, valid IDs of users within the Smartsheet organization the access token belongs to are required.
|
|
32
|
-
|
|
33
|
-
In addition, reports tests will be skipped unless there is a report within the organization. The report will not be modified or deleted, but must exist in order to acceptance-test the API methods pertaining to Reports.
|
|
34
|
-
|
|
35
|
-
The `admin` user needs at least one Contact.
|
|
36
|
-
|
|
37
|
-
Finally, the user corresponding to `moe` needs to be a Licensed User. `larry` and `curly` do not need to be Licensed Users.
|
tests/integration/conftest.py
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
import smartsheet
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
from dateutil.tz import *
|
|
5
|
-
import json
|
|
6
|
-
import os
|
|
7
|
-
import six
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@pytest.fixture(scope="module")
|
|
11
|
-
def smart_setup(request):
|
|
12
|
-
# set up a test session folder with basic starting points
|
|
13
|
-
smart = smartsheet.Smartsheet(max_retry_time=60)
|
|
14
|
-
now = datetime.now(tzlocal()).strftime("%Y-%m-%d %H:%M:%S")
|
|
15
|
-
|
|
16
|
-
users = os.environ.get('SMARTSHEET_FIXTURE_USERS', None)
|
|
17
|
-
if users is None:
|
|
18
|
-
pytest.exit('Environment not setup correctly...aborting')
|
|
19
|
-
|
|
20
|
-
users = json.loads(users)
|
|
21
|
-
fixusers = {}
|
|
22
|
-
for nick,info in six.iteritems(users):
|
|
23
|
-
profile = smart.Users.get_user(info['id'])
|
|
24
|
-
assert isinstance(profile, smart.models.UserProfile)
|
|
25
|
-
fixusers[nick] = profile
|
|
26
|
-
action = smart.Groups.list_groups(include_all=True)
|
|
27
|
-
assert isinstance(action, smart.models.IndexResult)
|
|
28
|
-
grps = action.result
|
|
29
|
-
groups = {}
|
|
30
|
-
need_exec = True
|
|
31
|
-
for gp in grps:
|
|
32
|
-
groups[gp.name] = gp
|
|
33
|
-
if gp.name == 'exec':
|
|
34
|
-
need_exec = False
|
|
35
|
-
|
|
36
|
-
if need_exec:
|
|
37
|
-
group = smart.models.Group({
|
|
38
|
-
'name': 'exec',
|
|
39
|
-
'members': [
|
|
40
|
-
smart.models.GroupMember({
|
|
41
|
-
'email': fixusers['moe'].email
|
|
42
|
-
}),
|
|
43
|
-
smart.models.GroupMember({
|
|
44
|
-
'email': fixusers['admin'].email
|
|
45
|
-
})
|
|
46
|
-
]
|
|
47
|
-
})
|
|
48
|
-
action = smart.Groups.create_group(group)
|
|
49
|
-
assert action.message == 'SUCCESS'
|
|
50
|
-
|
|
51
|
-
# test run base folders
|
|
52
|
-
folder_name = 'pytest ' + now
|
|
53
|
-
action = smart.Home.create_folder(folder_name)
|
|
54
|
-
assert action.message == 'SUCCESS'
|
|
55
|
-
test_folder = action.result
|
|
56
|
-
|
|
57
|
-
# add a sheet to mess around with
|
|
58
|
-
sheet = smart.models.Sheet({
|
|
59
|
-
'name': 'pytest_fixture_sheet ' + now,
|
|
60
|
-
'columns': [{
|
|
61
|
-
'title': 'The First Column',
|
|
62
|
-
'primary': True,
|
|
63
|
-
'type': 'TEXT_NUMBER'
|
|
64
|
-
}, {
|
|
65
|
-
'title': 'Favorite',
|
|
66
|
-
'type': 'CHECKBOX',
|
|
67
|
-
'symbol': 'STAR'
|
|
68
|
-
}, {
|
|
69
|
-
'title': 'Disposable',
|
|
70
|
-
'type': 'TEXT_NUMBER'
|
|
71
|
-
}]
|
|
72
|
-
})
|
|
73
|
-
action = smart.Folders.create_sheet_in_folder(test_folder.id, sheet)
|
|
74
|
-
assert action.message == 'SUCCESS'
|
|
75
|
-
sheet = action.result
|
|
76
|
-
|
|
77
|
-
# get primary column id
|
|
78
|
-
for idx, col in enumerate(sheet.columns):
|
|
79
|
-
if col.primary:
|
|
80
|
-
break
|
|
81
|
-
sheet_primary_col = col
|
|
82
|
-
|
|
83
|
-
# add a row
|
|
84
|
-
action = sheet.add_rows([smart.models.Row({
|
|
85
|
-
'to_top': True,
|
|
86
|
-
'cells': [{
|
|
87
|
-
'column_id': sheet_primary_col.id,
|
|
88
|
-
'value': 'The first column of the first row.'
|
|
89
|
-
}]
|
|
90
|
-
})])
|
|
91
|
-
assert action.message == 'SUCCESS'
|
|
92
|
-
|
|
93
|
-
sheet = smart.Sheets.get_sheet(sheet.id)
|
|
94
|
-
assert isinstance(sheet, smart.models.Sheet)
|
|
95
|
-
|
|
96
|
-
sheet_b = smart.models.Sheet({
|
|
97
|
-
'name': 'pytest_fixture_sheetB ' + now,
|
|
98
|
-
'columns': [{
|
|
99
|
-
'title': 'Brand',
|
|
100
|
-
'primary': True,
|
|
101
|
-
'type': 'TEXT_NUMBER'
|
|
102
|
-
}]
|
|
103
|
-
})
|
|
104
|
-
action = smart.Folders.create_sheet_in_folder(test_folder.id, sheet_b)
|
|
105
|
-
assert action.message == 'SUCCESS'
|
|
106
|
-
sheet_b = action.result
|
|
107
|
-
for idx, col in enumerate(sheet_b.columns):
|
|
108
|
-
if col.primary:
|
|
109
|
-
break
|
|
110
|
-
sheet_b_primary_col = col
|
|
111
|
-
|
|
112
|
-
action = sheet_b.add_rows([
|
|
113
|
-
smart.models.Row({
|
|
114
|
-
'to_top': True,
|
|
115
|
-
'cells': [{
|
|
116
|
-
'column_id': sheet_b_primary_col.id,
|
|
117
|
-
'value': 'Nike'
|
|
118
|
-
}]
|
|
119
|
-
}),
|
|
120
|
-
smart.models.Row({
|
|
121
|
-
'to_top': True,
|
|
122
|
-
'cells': [{
|
|
123
|
-
'column_id': sheet_b_primary_col.id,
|
|
124
|
-
'value': 'Google'
|
|
125
|
-
}]
|
|
126
|
-
}),
|
|
127
|
-
smart.models.Row({
|
|
128
|
-
'to_top': True,
|
|
129
|
-
'cells': [{
|
|
130
|
-
'column_id': sheet_b_primary_col.id,
|
|
131
|
-
'value': 'Adidas'
|
|
132
|
-
}]
|
|
133
|
-
}),
|
|
134
|
-
smart.models.Row({
|
|
135
|
-
'to_top': True,
|
|
136
|
-
'cells': [{
|
|
137
|
-
'column_id': sheet_b_primary_col.id,
|
|
138
|
-
'value': 'Keen'
|
|
139
|
-
}]
|
|
140
|
-
})])
|
|
141
|
-
assert action.message == 'SUCCESS'
|
|
142
|
-
|
|
143
|
-
sheet_b = smart.Sheets.get_sheet(sheet_b.id)
|
|
144
|
-
assert isinstance(sheet_b, smart.models.Sheet)
|
|
145
|
-
|
|
146
|
-
fixture = {
|
|
147
|
-
'smart': smart,
|
|
148
|
-
'folder': test_folder,
|
|
149
|
-
'sheet': sheet,
|
|
150
|
-
'sheet_primary_col': sheet_primary_col,
|
|
151
|
-
'sheet_b': sheet_b,
|
|
152
|
-
'sheet_b_primary_col': sheet_b_primary_col,
|
|
153
|
-
'now': now,
|
|
154
|
-
'users': fixusers,
|
|
155
|
-
'groups': groups
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
def smart_teardown():
|
|
159
|
-
action = fixture['smart'].Sheets.delete_sheet(fixture['sheet'].id)
|
|
160
|
-
assert action.message == 'SUCCESS'
|
|
161
|
-
print("deleted fixture sheet")
|
|
162
|
-
action = fixture['smart'].Sheets.delete_sheet(fixture['sheet_b'].id)
|
|
163
|
-
assert action.message == 'SUCCESS'
|
|
164
|
-
print("deleted fixture sheet_b")
|
|
165
|
-
action = fixture['smart'].Folders.delete_folder(fixture['folder'].id)
|
|
166
|
-
assert action.message == 'SUCCESS'
|
|
167
|
-
print("deleted fixture folder")
|
|
168
|
-
if 'folder_b' in fixture:
|
|
169
|
-
action = fixture['smart'].Folders.delete_folder(fixture['folder_b'].id)
|
|
170
|
-
assert action.message == 'SUCCESS'
|
|
171
|
-
print("deleted fixture folder_b")
|
|
172
|
-
|
|
173
|
-
request.addfinalizer(smart_teardown)
|
|
174
|
-
return fixture
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Curly: "Hmmm, n'yuk, n'yuk, n'yuk. He must be a Pointsetter!"
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
n'yuk, n'yuk, n'yuk!
|
|
Binary file
|
|
Binary file
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
import os.path
|
|
3
|
-
|
|
4
|
-
_dir = os.path.dirname(os.path.abspath(__file__))
|
|
5
|
-
|
|
6
|
-
@pytest.mark.usefixtures("smart_setup")
|
|
7
|
-
class TestAttachments:
|
|
8
|
-
row_url_attachment = None
|
|
9
|
-
sheet_file_attachment = None
|
|
10
|
-
|
|
11
|
-
# SEE TestDiscussions for this test
|
|
12
|
-
# def test_attach_url_to_comment(self, smart_setup):
|
|
13
|
-
# smart = smart_setup['smart']
|
|
14
|
-
|
|
15
|
-
def test_attach_url_to_sheet(self, smart_setup):
|
|
16
|
-
smart = smart_setup['smart']
|
|
17
|
-
url = smart.models.Attachment({
|
|
18
|
-
'name': 'find stuff',
|
|
19
|
-
'description': 'Maybe you have heard of this.',
|
|
20
|
-
'url': 'http://www.google.com/',
|
|
21
|
-
'attachment_type': 'LINK'
|
|
22
|
-
})
|
|
23
|
-
action = smart_setup['sheet_b'].attach_url(url)
|
|
24
|
-
assert action.message == 'SUCCESS'
|
|
25
|
-
|
|
26
|
-
def test_attach_url_to_row(self, smart_setup):
|
|
27
|
-
smart = smart_setup['smart']
|
|
28
|
-
url = smart.models.Attachment({
|
|
29
|
-
'name': 'find stuff',
|
|
30
|
-
'description': 'Maybe you have heard of this.',
|
|
31
|
-
'url': 'http://www.google.com/',
|
|
32
|
-
'attachment_type': 'LINK'
|
|
33
|
-
})
|
|
34
|
-
action = smart.Attachments.attach_url_to_row(
|
|
35
|
-
smart_setup['sheet_b'].id,
|
|
36
|
-
smart_setup['sheet_b'].rows[0].id,
|
|
37
|
-
url
|
|
38
|
-
)
|
|
39
|
-
assert action.message == 'SUCCESS'
|
|
40
|
-
TestAttachments.row_url_attachment = action.result
|
|
41
|
-
|
|
42
|
-
def test_attach_file_to_sheet(self, smart_setup):
|
|
43
|
-
smart = smart_setup['smart']
|
|
44
|
-
action = smart.Attachments.attach_file_to_sheet(
|
|
45
|
-
smart_setup['sheet_b'].id,
|
|
46
|
-
('stooges.jpg', open(_dir + '/fixtures/stooges_v1.jpg', 'rb'), 'image/jpeg')
|
|
47
|
-
)
|
|
48
|
-
assert action.message == 'SUCCESS'
|
|
49
|
-
TestAttachments.sheet_file_attachment = action.result
|
|
50
|
-
|
|
51
|
-
def test_list_all_attachments(self, smart_setup):
|
|
52
|
-
smart = smart_setup['smart']
|
|
53
|
-
action = smart.Attachments.list_all_attachments(
|
|
54
|
-
smart_setup['sheet_b'].id
|
|
55
|
-
)
|
|
56
|
-
assert action.total_count > 0
|
|
57
|
-
|
|
58
|
-
def test_attach_new_version(self, smart_setup):
|
|
59
|
-
smart = smart_setup['smart']
|
|
60
|
-
action = smart.Attachments.attach_new_version(
|
|
61
|
-
smart_setup['sheet_b'].id,
|
|
62
|
-
TestAttachments.sheet_file_attachment.id,
|
|
63
|
-
('stooges.jpg', open(_dir + '/fixtures/stooges_v2.jpg', 'rb'), 'image/jpeg')
|
|
64
|
-
)
|
|
65
|
-
assert action.message == 'SUCCESS'
|
|
66
|
-
|
|
67
|
-
def test_list_attachment_versions(self, smart_setup):
|
|
68
|
-
smart = smart_setup['smart']
|
|
69
|
-
action = smart.Attachments.list_attachment_versions(
|
|
70
|
-
smart_setup['sheet_b'].id,
|
|
71
|
-
TestAttachments.sheet_file_attachment.id
|
|
72
|
-
)
|
|
73
|
-
assert action.total_count > 0
|
|
74
|
-
vlist = action.result
|
|
75
|
-
assert isinstance(action.result[0], smart.models.attachment.Attachment)
|
|
76
|
-
|
|
77
|
-
def test_delete_attachment(self, smart_setup):
|
|
78
|
-
smart = smart_setup['smart']
|
|
79
|
-
action = smart.Attachments.delete_attachment(
|
|
80
|
-
smart_setup['sheet_b'].id,
|
|
81
|
-
TestAttachments.row_url_attachment.id
|
|
82
|
-
)
|
|
83
|
-
assert action.message == 'SUCCESS'
|
|
84
|
-
|
|
85
|
-
def test_get_attachment(self, smart_setup):
|
|
86
|
-
smart = smart_setup['smart']
|
|
87
|
-
file = smart.Attachments.get_attachment(
|
|
88
|
-
smart_setup['sheet_b'].id,
|
|
89
|
-
TestAttachments.sheet_file_attachment.id
|
|
90
|
-
)
|
|
91
|
-
assert file.name == 'stooges.jpg'
|
|
92
|
-
|
|
93
|
-
def test_delete_attachment_versions(self, smart_setup):
|
|
94
|
-
smart = smart_setup['smart']
|
|
95
|
-
action = smart.Attachments.delete_attachment_versions(
|
|
96
|
-
smart_setup['sheet_b'].id,
|
|
97
|
-
TestAttachments.sheet_file_attachment.id
|
|
98
|
-
)
|
|
99
|
-
assert action.message == 'SUCCESS'
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
import six
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
@pytest.mark.usefixtures("smart_setup")
|
|
6
|
-
class TestColumns:
|
|
7
|
-
test_columns = None
|
|
8
|
-
|
|
9
|
-
def test_add_columns(self, smart_setup):
|
|
10
|
-
smart = smart_setup['smart']
|
|
11
|
-
action = smart_setup['sheet'].add_columns([
|
|
12
|
-
smart.models.Column({
|
|
13
|
-
'title': 'Cheese',
|
|
14
|
-
'type': 'TEXT_NUMBER',
|
|
15
|
-
'index': 1
|
|
16
|
-
}),
|
|
17
|
-
smart.models.Column({
|
|
18
|
-
'title': 'Hotdog',
|
|
19
|
-
'type': 'TEXT_NUMBER',
|
|
20
|
-
'index': 1
|
|
21
|
-
})
|
|
22
|
-
])
|
|
23
|
-
sheet = action.result
|
|
24
|
-
assert action.message == 'SUCCESS'
|
|
25
|
-
|
|
26
|
-
def test_add_column_with_dict(self, smart_setup):
|
|
27
|
-
smart = smart_setup['smart']
|
|
28
|
-
action = smart_setup['sheet'].add_columns({
|
|
29
|
-
'title': 'Model',
|
|
30
|
-
'type': 'TEXT_NUMBER',
|
|
31
|
-
'index': 2
|
|
32
|
-
})
|
|
33
|
-
sheet = action.result
|
|
34
|
-
assert action.message == 'SUCCESS'
|
|
35
|
-
|
|
36
|
-
def test_get_columns(self, smart_setup):
|
|
37
|
-
smart = smart_setup['smart']
|
|
38
|
-
action = smart_setup['sheet'].get_columns()
|
|
39
|
-
columns = action.result
|
|
40
|
-
TestColumns.test_columns = columns
|
|
41
|
-
assert action.total_count > 0
|
|
42
|
-
|
|
43
|
-
def test_get_column(self, smart_setup):
|
|
44
|
-
smart = smart_setup['smart']
|
|
45
|
-
some_column = smart_setup['sheet'].columns.pop()
|
|
46
|
-
column = smart_setup['sheet'].get_column(some_column.id)
|
|
47
|
-
assert isinstance(column.id, six.integer_types)
|
|
48
|
-
|
|
49
|
-
def test_update_column(self, smart_setup):
|
|
50
|
-
smart = smart_setup['smart']
|
|
51
|
-
for idx, col in enumerate(TestColumns.test_columns):
|
|
52
|
-
if col.title == 'Hotdog':
|
|
53
|
-
break
|
|
54
|
-
new_col = smart.models.Column()
|
|
55
|
-
new_col.title = 'Brand of Hotdog'
|
|
56
|
-
action = smart.Sheets.update_column(
|
|
57
|
-
smart_setup['sheet'].id,
|
|
58
|
-
col.id,
|
|
59
|
-
new_col
|
|
60
|
-
)
|
|
61
|
-
column = action.result
|
|
62
|
-
assert action.message == 'SUCCESS'
|
|
63
|
-
|
|
64
|
-
def test_delete_column(self, smart_setup):
|
|
65
|
-
smart = smart_setup['smart']
|
|
66
|
-
for idx, col in enumerate(TestColumns.test_columns):
|
|
67
|
-
if col.title == 'Disposable':
|
|
68
|
-
break
|
|
69
|
-
action = smart.Sheets.delete_column(
|
|
70
|
-
smart_setup['sheet'].id,
|
|
71
|
-
col.id
|
|
72
|
-
)
|
|
73
|
-
assert action.message == 'SUCCESS'
|
|
74
|
-
|
|
75
|
-
def test_column_formulas(self, smart_setup):
|
|
76
|
-
smart = smart_setup['smart']
|
|
77
|
-
action = smart_setup['sheet'].add_columns({
|
|
78
|
-
'title': 'Column Formula',
|
|
79
|
-
'type': 'DATE',
|
|
80
|
-
'index': 1,
|
|
81
|
-
'formula': '=TODAY()'
|
|
82
|
-
})
|
|
83
|
-
cols = action.result
|
|
84
|
-
assert action.message == 'SUCCESS'
|
|
85
|
-
assert cols[0].formula is not None
|
|
86
|
-
|
|
87
|
-
action = smart.Sheets.update_column(smart_setup['sheet'].id, cols[0].id,
|
|
88
|
-
{'formula': ''})
|
|
89
|
-
col = action.result
|
|
90
|
-
assert action.message == 'SUCCESS'
|
|
91
|
-
assert col.formula is None
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
from smartsheet.util import serialize
|
|
3
|
-
|
|
4
|
-
@pytest.mark.usefixtures("smart_setup")
|
|
5
|
-
class TestContacts:
|
|
6
|
-
my_contacts = None
|
|
7
|
-
|
|
8
|
-
def test_list_contacts(self, smart_setup):
|
|
9
|
-
smart = smart_setup['smart']
|
|
10
|
-
action = smart.Contacts.list_contacts()
|
|
11
|
-
assert action.request_response.status_code == 200
|
|
12
|
-
assert action.total_count > 0
|
|
13
|
-
TestContacts.my_contacts = action.result
|
|
14
|
-
|
|
15
|
-
def test_get_contact(self, smart_setup):
|
|
16
|
-
smart = smart_setup['smart']
|
|
17
|
-
contact = smart.Contacts.get_contact(
|
|
18
|
-
TestContacts.my_contacts[0].id
|
|
19
|
-
)
|
|
20
|
-
email = contact.email
|
|
21
|
-
name = contact.name
|
|
22
|
-
id_ = contact.id
|
|
23
|
-
contact_dict = contact.to_dict()
|
|
24
|
-
assert contact.request_response.status_code == 200
|
|
25
|
-
assert contact_dict['email'] == email
|
|
26
|
-
assert contact_dict['name'] == name
|
|
27
|
-
assert contact_dict['id'] == id_
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import pytest
|
|
2
|
-
import smartsheet
|
|
3
|
-
|
|
4
|
-
@pytest.mark.usefixtures("smart_setup")
|
|
5
|
-
class TestCrossSheetReferences:
|
|
6
|
-
|
|
7
|
-
def test_create_cross_sheet_reference(self, smart_setup):
|
|
8
|
-
smart = smart_setup['smart']
|
|
9
|
-
xref = smart.models.CrossSheetReference()
|
|
10
|
-
xref.source_sheet_id = smart_setup['sheet_b'].id
|
|
11
|
-
xref.start_column_id = smart_setup['sheet_b'].columns[0].id
|
|
12
|
-
xref.end_column_id = smart_setup['sheet_b'].columns[0].id
|
|
13
|
-
action = smart.Sheets.create_cross_sheet_reference(smart_setup['sheet'].id, xref)
|
|
14
|
-
assert action.message == 'SUCCESS'
|
|
15
|
-
|
|
16
|
-
def test_list_cross_sheet_references(self, smart_setup):
|
|
17
|
-
smart = smart_setup['smart']
|
|
18
|
-
action = smart.Sheets.list_cross_sheet_references(smart_setup['sheet'].id)
|
|
19
|
-
assert isinstance(action.data[0], smart.models.CrossSheetReference)
|
|
20
|
-
|
|
21
|
-
def test_get_cross_sheet_references(self, smart_setup):
|
|
22
|
-
smart = smart_setup['smart']
|
|
23
|
-
action = smart.Sheets.get_sheet(smart_setup['sheet'].id, include='crossSheetReferences')
|
|
24
|
-
assert isinstance(action, smart.models.Sheet)
|
|
25
|
-
assert len(action.cross_sheet_references) == 1
|
|
26
|
-
|
|
27
|
-
action = smart.Sheets.get_cross_sheet_reference(smart_setup['sheet'].id, action.cross_sheet_references[0].id)
|
|
28
|
-
assert isinstance(action, smart.models.CrossSheetReference)
|
|
29
|
-
|
|
30
|
-
|