@@ -174,7 +174,8 @@ def test_create_upload(self):
174174 size = os .stat (path ).st_size
175175
176176 # test thumbnail upload
177- data = {'image' : path , 'name' : 'Test Version' }
177+ data = {'image' : path , 'code' : 'Test Version' ,
178+ 'project' : self .project }
178179 new_version = self .sg .create ("Version" , data , return_fields = ['image' ])
179180 self .assertTrue (new_version is not None )
180181 self .assertTrue (new_version .get ('image' ) is not None )
@@ -183,26 +184,20 @@ def test_create_upload(self):
183184 self .sg .download_attachment (new_version .get ('image_id' ))
184185 self .assertTrue (attach_file is not None )
185186 self .assertEqual (size , len (attach_file ))
186- orig_file . open (path , "rb" ).read ()
187+ orig_file = open (path , "rb" ).read ()
187188 self .assertEqual (orig_file , attach_file )
188189
189190 # test filmstrip image upload
190- data = {'filmstrip_image' : path , 'name' : 'Test Version' }
191- new_version = self .sg .create ("Version" , data , return_fields = ['image' ])
191+ data = {'filmstrip_image' : path , 'code' : 'Test Version' ,
192+ 'project' : self .project }
193+ new_version = self .sg .create ("Version" , data , return_fields = ['filmstrip_image' ])
192194 self .assertTrue (new_version is not None )
193195 self .assertTrue (new_version .get ('filmstrip_image' ) is not None )
194196 self .assertTrue (new_version .get ('filmstrip_image_id' ) is not None )
195197 attach_file = \
196198 self .sg .download_attachment (new_version .get ('filmstrip_image_id' ))
197199 self .assertTrue (attach_file is not None )
198200 self .assertEqual (size , len (attach_file ))
199- orig_file .open (path , "rb" ).read ()
200- self .assertEqual (orig_file , attach_file )
201-
202- attach_file = self .sg .download_attachment (attach_id )
203- self .assertTrue (attach_file is not None )
204- self .assertEqual (size , len (attach_file ))
205-
206201 orig_file = open (path , "rb" ).read ()
207202 self .assertEqual (orig_file , attach_file )
208203 # end test_create_upload
@@ -248,7 +243,6 @@ def test_thumbnail_url(self):
248243 }
249244 ]
250245
251- print expected , response
252246 self .assertEqual (expected , response )
253247
254248 response_version_with_project = self .sg .find (
@@ -320,7 +314,6 @@ def test_ensure_unicode(self):
320314 self .config .api_key ,
321315 ensure_ascii = False )
322316 result = sg_unicode .find_one ('Note' , [['id' ,'is' ,self .note ['id' ]]], fields = ['content' ])
323- print result
324317 self .assertTrue (_has_unicode (result ))
325318
326319 def test_work_schedule (self ):
0 commit comments