@@ -171,8 +171,8 @@ def test_upload_download(self):
171171 os .path .join (this_dir , "sg_logo.jpg" )))
172172 size = os .stat (path ).st_size
173173
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 ' ,
176176 tag_list = "monkeys, everywhere, send, help" )
177177
178178 # test download with attachment_id
@@ -201,12 +201,12 @@ def test_upload_download(self):
201201 self .assertEqual (orig_file , attach_file )
202202
203203 # 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 ' ])
206206
207207 # Look for the attachment we just uploaded, the attachments are not returned from latest
208208 # 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 ) ]
210210 self .assertEqual (len (attachment ), 1 )
211211
212212 attachment = attachment [0 ]
@@ -254,10 +254,10 @@ def test_upload_download(self):
254254 # only checking that the non-ascii string encoding doesn't trip
255255 # us up the way it used to.
256256 self .sg .upload (
257- "Ticket " ,
258- self .ticket ['id' ],
257+ "Version " ,
258+ self .version ['id' ],
259259 u_path ,
260- 'attachments ' ,
260+ 'sg_uploaded_movie ' ,
261261 tag_list = "monkeys, everywhere, send, help"
262262 )
263263
@@ -266,10 +266,10 @@ def test_upload_download(self):
266266 # primarily a concern on Windows, as it doesn't handle that
267267 # situation as well as OS X and Linux.
268268 self .sg .upload (
269- "Ticket " ,
270- self .ticket ['id' ],
269+ "Version " ,
270+ self .version ['id' ],
271271 u_path .encode ("utf-8" ),
272- 'attachments ' ,
272+ 'sg_uploaded_movie ' ,
273273 tag_list = "monkeys, everywhere, send, help"
274274 )
275275 if six .PY2 :
@@ -290,19 +290,19 @@ def test_upload_download(self):
290290 self .assertRaises (
291291 shotgun_api3 .ShotgunError ,
292292 self .sg .upload ,
293- "Ticket " ,
294- self .ticket ['id' ],
293+ "Version " ,
294+ self .version ['id' ],
295295 file_path_u .encode ("shift-jis" ),
296- 'attachments ' ,
296+ 'sg_uploaded_movie ' ,
297297 tag_list = "monkeys, everywhere, send, help"
298298 )
299299
300300 # But it should work in all cases if a unicode string is used.
301301 self .sg .upload (
302- "Ticket " ,
303- self .ticket ['id' ],
302+ "Version " ,
303+ self .version ['id' ],
304304 file_path_u ,
305- 'attachments ' ,
305+ 'sg_uploaded_movie ' ,
306306 tag_list = "monkeys, everywhere, send, help"
307307 )
308308
@@ -330,8 +330,8 @@ def test_upload_to_sg(self, mock_send_form):
330330 )
331331 )
332332 upload_id = self .sg .upload (
333- "Ticket " ,
334- self .ticket ['id' ],
333+ "Version " ,
334+ self .version ['id' ],
335335 u_path ,
336336 'attachments' ,
337337 tag_list = "monkeys, everywhere, send, help"
@@ -345,8 +345,8 @@ def test_upload_to_sg(self, mock_send_form):
345345 )
346346
347347 upload_id = self .sg .upload (
348- "Ticket " ,
349- self .ticket ['id' ],
348+ "Version " ,
349+ self .version ['id' ],
350350 u_path ,
351351 'filmstrip_image' ,
352352 tag_list = "monkeys, everywhere, send, help" ,
@@ -365,8 +365,8 @@ def test_upload_to_sg(self, mock_send_form):
365365 self .assertRaises (
366366 shotgun_api3 .ShotgunError ,
367367 self .sg .upload ,
368- "Ticket " ,
369- self .ticket ['id' ],
368+ "Version " ,
369+ self .version ['id' ],
370370 u_path ,
371371 'attachments' ,
372372 tag_list = "monkeys, everywhere, send, help"
@@ -1525,30 +1525,30 @@ def test_in_relation_comma_list(self):
15251525 """
15261526 Test that 'in' relation using commas (old format) works with list fields.
15271527 """
1528- filters = [['sg_priority ' , 'in' , self .ticket [ 'sg_priority ' ], '1' ],
1528+ filters = [['frame_count ' , 'in' , self .version [ 'frame_count ' ], 33 ],
15291529 ['project' , 'is' , self .project ]]
15301530
1531- result = self ._id_in_result ('Ticket ' , filters , self .ticket ['id' ])
1531+ result = self ._id_in_result ('Version ' , filters , self .version ['id' ])
15321532 self .assertTrue (result )
15331533
15341534 def test_in_relation_list_list (self ):
15351535 """
15361536 Test that 'in' relation using list (new format) works with list fields.
15371537 """
1538- filters = [['sg_priority ' , 'in' , [self .ticket [ 'sg_priority ' ], '1' ]],
1538+ filters = [['frame_count ' , 'in' , [self .version [ 'frame_count ' ], 33 ]],
15391539 ['project' , 'is' , self .project ]]
15401540
1541- result = self ._id_in_result ('Ticket ' , filters , self .ticket ['id' ])
1541+ result = self ._id_in_result ('Version ' , filters , self .version ['id' ])
15421542 self .assertTrue (result )
15431543
15441544 def test_not_in_relation_list (self ):
15451545 """
15461546 Test that 'not_in' relation using commas (old format) works with list fields.
15471547 """
1548- filters = [['sg_priority ' , 'not_in' , [self .ticket [ 'sg_priority ' ], '1' ]],
1548+ filters = [['frame_count ' , 'not_in' , [self .version [ 'frame_count ' ], 33 ]],
15491549 ['project' , 'is' , self .project ]]
15501550
1551- result = self ._id_in_result ('Ticket ' , filters , self .ticket ['id' ])
1551+ result = self ._id_in_result ('Version ' , filters , self .version ['id' ])
15521552 self .assertFalse (result )
15531553
15541554 def test_in_relation_comma_multi_entity (self ):
0 commit comments