@@ -171,8 +171,8 @@ def test_upload_download(self):
171
171
os .path .join (this_dir , "sg_logo.jpg" )))
172
172
size = os .stat (path ).st_size
173
173
174
- attach_id = self .sg .upload ("Ticket " ,
175
- self .ticket ['id' ], path , 'attachments ' ,
174
+ attach_id = self .sg .upload ("Version " ,
175
+ self .version ['id' ], path , 'sg_uploaded_movie ' ,
176
176
tag_list = "monkeys, everywhere, send, help" )
177
177
178
178
# test download with attachment_id
@@ -201,12 +201,12 @@ def test_upload_download(self):
201
201
self .assertEqual (orig_file , attach_file )
202
202
203
203
# test download with attachment hash
204
- ticket = self .sg .find_one ('Ticket ' , [['id' , 'is' , self .ticket ['id' ]]],
205
- ['attachments ' ])
204
+ version = self .sg .find_one ('Version ' , [['id' , 'is' , self .version ['id' ]]],
205
+ ['sg_uploaded_movie ' ])
206
206
207
207
# Look for the attachment we just uploaded, the attachments are not returned from latest
208
208
# to earliest.
209
- attachment = [x for x in ticket [ "attachments" ] if x [ "id" ] == attach_id ]
209
+ attachment = [v for k , v in version [ "sg_uploaded_movie" ]. items () if ( k , v ) == ( "id" , attach_id ) ]
210
210
self .assertEqual (len (attachment ), 1 )
211
211
212
212
attachment = attachment [0 ]
@@ -254,10 +254,10 @@ def test_upload_download(self):
254
254
# only checking that the non-ascii string encoding doesn't trip
255
255
# us up the way it used to.
256
256
self .sg .upload (
257
- "Ticket " ,
258
- self .ticket ['id' ],
257
+ "Version " ,
258
+ self .version ['id' ],
259
259
u_path ,
260
- 'attachments ' ,
260
+ 'sg_uploaded_movie ' ,
261
261
tag_list = "monkeys, everywhere, send, help"
262
262
)
263
263
@@ -266,10 +266,10 @@ def test_upload_download(self):
266
266
# primarily a concern on Windows, as it doesn't handle that
267
267
# situation as well as OS X and Linux.
268
268
self .sg .upload (
269
- "Ticket " ,
270
- self .ticket ['id' ],
269
+ "Version " ,
270
+ self .version ['id' ],
271
271
u_path .encode ("utf-8" ),
272
- 'attachments ' ,
272
+ 'sg_uploaded_movie ' ,
273
273
tag_list = "monkeys, everywhere, send, help"
274
274
)
275
275
if six .PY2 :
@@ -290,19 +290,19 @@ def test_upload_download(self):
290
290
self .assertRaises (
291
291
shotgun_api3 .ShotgunError ,
292
292
self .sg .upload ,
293
- "Ticket " ,
294
- self .ticket ['id' ],
293
+ "Version " ,
294
+ self .version ['id' ],
295
295
file_path_u .encode ("shift-jis" ),
296
- 'attachments ' ,
296
+ 'sg_uploaded_movie ' ,
297
297
tag_list = "monkeys, everywhere, send, help"
298
298
)
299
299
300
300
# But it should work in all cases if a unicode string is used.
301
301
self .sg .upload (
302
- "Ticket " ,
303
- self .ticket ['id' ],
302
+ "Version " ,
303
+ self .version ['id' ],
304
304
file_path_u ,
305
- 'attachments ' ,
305
+ 'sg_uploaded_movie ' ,
306
306
tag_list = "monkeys, everywhere, send, help"
307
307
)
308
308
@@ -330,8 +330,8 @@ def test_upload_to_sg(self, mock_send_form):
330
330
)
331
331
)
332
332
upload_id = self .sg .upload (
333
- "Ticket " ,
334
- self .ticket ['id' ],
333
+ "Version " ,
334
+ self .version ['id' ],
335
335
u_path ,
336
336
'attachments' ,
337
337
tag_list = "monkeys, everywhere, send, help"
@@ -345,8 +345,8 @@ def test_upload_to_sg(self, mock_send_form):
345
345
)
346
346
347
347
upload_id = self .sg .upload (
348
- "Ticket " ,
349
- self .ticket ['id' ],
348
+ "Version " ,
349
+ self .version ['id' ],
350
350
u_path ,
351
351
'filmstrip_image' ,
352
352
tag_list = "monkeys, everywhere, send, help" ,
@@ -365,8 +365,8 @@ def test_upload_to_sg(self, mock_send_form):
365
365
self .assertRaises (
366
366
shotgun_api3 .ShotgunError ,
367
367
self .sg .upload ,
368
- "Ticket " ,
369
- self .ticket ['id' ],
368
+ "Version " ,
369
+ self .version ['id' ],
370
370
u_path ,
371
371
'attachments' ,
372
372
tag_list = "monkeys, everywhere, send, help"
@@ -1525,30 +1525,30 @@ def test_in_relation_comma_list(self):
1525
1525
"""
1526
1526
Test that 'in' relation using commas (old format) works with list fields.
1527
1527
"""
1528
- filters = [['sg_priority ' , 'in' , self .ticket [ 'sg_priority ' ], '1' ],
1528
+ filters = [['frame_count ' , 'in' , self .version [ 'frame_count ' ], 33 ],
1529
1529
['project' , 'is' , self .project ]]
1530
1530
1531
- result = self ._id_in_result ('Ticket ' , filters , self .ticket ['id' ])
1531
+ result = self ._id_in_result ('Version ' , filters , self .version ['id' ])
1532
1532
self .assertTrue (result )
1533
1533
1534
1534
def test_in_relation_list_list (self ):
1535
1535
"""
1536
1536
Test that 'in' relation using list (new format) works with list fields.
1537
1537
"""
1538
- filters = [['sg_priority ' , 'in' , [self .ticket [ 'sg_priority ' ], '1' ]],
1538
+ filters = [['frame_count ' , 'in' , [self .version [ 'frame_count ' ], 33 ]],
1539
1539
['project' , 'is' , self .project ]]
1540
1540
1541
- result = self ._id_in_result ('Ticket ' , filters , self .ticket ['id' ])
1541
+ result = self ._id_in_result ('Version ' , filters , self .version ['id' ])
1542
1542
self .assertTrue (result )
1543
1543
1544
1544
def test_not_in_relation_list (self ):
1545
1545
"""
1546
1546
Test that 'not_in' relation using commas (old format) works with list fields.
1547
1547
"""
1548
- filters = [['sg_priority ' , 'not_in' , [self .ticket [ 'sg_priority ' ], '1' ]],
1548
+ filters = [['frame_count ' , 'not_in' , [self .version [ 'frame_count ' ], 33 ]],
1549
1549
['project' , 'is' , self .project ]]
1550
1550
1551
- result = self ._id_in_result ('Ticket ' , filters , self .ticket ['id' ])
1551
+ result = self ._id_in_result ('Version ' , filters , self .version ['id' ])
1552
1552
self .assertFalse (result )
1553
1553
1554
1554
def test_in_relation_comma_multi_entity (self ):
0 commit comments