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