'Replace SsyncSender with a thin Fake.
:param ssync_calls: an empty list, a non_local, all calls to ssync will
be captured for assertion in the caller.
:param fail_jobs: optional iter of dicts, any job passed into Fake that
matches a failure dict will return success == False.'

def _make_fake_ssync(self, ssync_calls, fail_jobs=None):

    class _fake_ssync(object, ):
        def __init__(self, daemon, node, job, suffixes, **kwargs):
            context = {}
            context['node'] = node
            context['job'] = job
            context['suffixes'] = suffixes
            self.suffixes = suffixes
            self.daemon = daemon
            self.job = job
            hash_gen = self.daemon._df_router[job['policy']].yield_hashes(self.job['device'], self.job['partition'], self.job['policy'], self.suffixes, frag_index=self.job.get('frag_index'))
            self.available_map = {}
            for (hash_, timestamps) in hash_gen:
                self.available_map[hash_] = timestamps
            context['available_map'] = self.available_map
            ssync_calls.append(context)
            self.success = True
            for failure in (fail_jobs or []):
                if all(((job.get(k) == v) for (k, v) in failure.items())):
                    self.success = False
                    break
            context['success'] = self.success
        def __call__(self, *args, **kwargs):
            return (self.success, (self.available_map if self.success else {}))
    return _fake_ssync
