<s> import logging ; log = logging . getLogger ( __name__ ) <EOL> from . import TEST_DATA_DIR , BaseAuthenticatedEndpointTestCase , BaseUserlessEndpointTestCase <EOL> import os <EOL> class PhotosEndpointTestCase ( BaseAuthenticatedEndpointTestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_photo ( self ) : <EOL> response = self . api . photos ( self . default_photoid ) <EOL> assert '<STR_LIT>' in response <EOL> def test_attach_photo ( self ) : <EOL> """<STR_LIT>""" <EOL> response = self . api . checkins . add ( params = { '<STR_LIT>' : self . default_venueid } ) <EOL> checkin = response . get ( '<STR_LIT>' ) <EOL> self . assertNotEqual ( checkin , None ) <EOL> test_photo = os . path . join ( TEST_DATA_DIR , '<STR_LIT>' ) <EOL> if os . path . isfile ( test_photo ) : <EOL> photo_data = open ( test_photo , '<STR_LIT:rb>' ) <EOL> try : <EOL> response = self . api . photos . add ( params = { '<STR_LIT>' : checkin [ '<STR_LIT:id>' ] } , photo_data = photo_data ) <EOL> assert '<STR_LIT>' in response <EOL> photo = response . get ( '<STR_LIT>' ) <EOL> self . assertNotEqual ( photo , None ) <EOL> self . assertEquals ( <NUM_LIT> , photo [ '<STR_LIT:width>' ] ) <EOL> self . assertEquals ( <NUM_LIT> , photo [ '<STR_LIT>' ] ) <EOL> finally : <EOL> photo_data . close ( ) <EOL> else : <EOL> print ( u"<STR_LIT>" ) </s>
