Example #1
0
    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'
Example #2
0
    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'
Example #3
0
 def __init__(self):
     UploadService.__init__(self, "yfrog.com", "/api/xauth_upload")
Example #4
0
 def __init__(self):
     UploadService.__init__(self, "twitgoo.com", "/api/upload")
Example #5
0
 def __init__(self):
     UploadService.__init__(self, "api.mobypicture.com", "/2.0/upload.xml")
Example #6
0
 def __init__(self):
     UploadService.__init__(self, "twitgoo.com", "/api/upload")
Example #7
0
 def __init__(self):
     UploadService.__init__(self, "api.twitpic.com", "/2/upload.xml")
Example #8
0
 def __init__(self):
     UploadService.__init__(self, "img.ly", "/api/2/upload.xml")
Example #9
0
 def __init__(self):
     UploadService.__init__(self, "yfrog.com", "/api/xauth_upload")
Example #10
0
 def __init__(self):
     UploadService.__init__(self, "api.twitpic.com", "/2/upload.xml")