def test_upload_pic(self, monkeypatch): account = DummyAccount() account.protocol = DummyProtocol() temp = DummyResponse('ble') fields = {'media': 'ble'} files = {'path': '/tmp/dummy'} custom_headers = {'Agent': 'DummyAgent'} monkeypatch.setattr(requests, 'post', lambda w, files, data, headers: temp) upload_service = UploadService('example.com', 'example.com/v1') response = upload_service._upload_pic(account, fields, files, custom_headers) assert response == 'ble'
def test_upload_pic(self, monkeypatch): account = DummyAccount() account.protocol = DummyProtocol() temp = DummyResponse('ble') fields = {'media': 'ble'} files = {'path': '/tmp/dummy'} custom_headers = {'Agent': 'DummyAgent'} monkeypatch.setattr(requests, 'post', lambda w, files, data, headers: temp) upload_service = UploadService('example.com', 'example.com/v1') response = upload_service._upload_pic(account, fields, files, custom_headers) assert response == 'ble'
def __init__(self): UploadService.__init__(self, "yfrog.com", "/api/xauth_upload")
def __init__(self): UploadService.__init__(self, "twitgoo.com", "/api/upload")
def __init__(self): UploadService.__init__(self, "api.mobypicture.com", "/2.0/upload.xml")
def __init__(self): UploadService.__init__(self, "twitgoo.com", "/api/upload")
def __init__(self): UploadService.__init__(self, "api.twitpic.com", "/2/upload.xml")
def __init__(self): UploadService.__init__(self, "img.ly", "/api/2/upload.xml")
def __init__(self): UploadService.__init__(self, "yfrog.com", "/api/xauth_upload")
def __init__(self): UploadService.__init__(self, "api.twitpic.com", "/2/upload.xml")