lp:~vrruiz/gallery-app/test-share-photo has the code which shares a photo with Facebook. The test mocks the friends-dispatcher service to capture the call to the Upload method, which is defined as:
When Friends calls to the Upload service, it does it asynchronously, expecting either success or failure functions to be called back after the photo has been posted. To mock the service, I've used python-dbusmock, which currently doesn't support callbacks, so the test doesn't work correctly.
lp:~vrruiz/gallery-app/test-share-photo has the code which shares a photo with Facebook. The test mocks the friends-dispatcher service to capture the call to the Upload method, which is defined as:
@dbus. service. method( DBUS_INTERFACE,
in_ signature= 'sss',
out_ signature= 's',
async_ callbacks= ('success' ,'failure' ))
def Upload(self, account_id, uri, description, success=STUB, failure=STUB):
When Friends calls to the Upload service, it does it asynchronously, expecting either success or failure functions to be called back after the photo has been posted. To mock the service, I've used python-dbusmock, which currently doesn't support callbacks, so the test doesn't work correctly.