'When we received a SYNC we wake up any deferreds that were waiting
for the sync with the given data.
Used by tests.'

def on_sync(self, data):

    d = self.awaiting_syncs.pop(data, None)
    if d:
        d.callback(data)
