def test_attach_photo(self):
        """Creates a checkin and attaches a photo to it."""
        response = self.api.checkins.add(params={'venueId': self.default_venueid})
        checkin = response.get('checkin')
        self.assertNotEqual(checkin, None)

        test_photo = os.path.join(TEST_DATA_DIR, 'test-photo.jpg')

        # Fail gracefully if we don't have a test photo on disk
        if os.path.isfile(test_photo):
            photo_data = open(test_photo, 'rb')
            try:
                response = self.api.photos.add(params={'checkinId': checkin['id']}, photo_data=photo_data)
                assert response in 'photo'
                photo = response.get('photo')
                self.assertNotEqual(photo, None)
                self.assertEquals(300, photo['width'])
                self.assertEquals(300, photo['height'])
            finally:
                photo_data.close()
        else:
            print(u"Put a 'test-photo.jpg' file in the testdata/ directory to enable this test.")
dataset/ETHPy150Open mLewisLogic/foursquare/foursquare/tests/test_photos.py/PhotosEndpointTestCase.test_attach_photo/swapped operands of `in`