def _get_partitioner(self, partitions, host='a'): fixture = self.useFixture(fixtures.CoordinatorFixture('zake://', host)) group = 'group' fixture.coordinator.create_group(group) fixture.coordinator.join_group(group) return coordination.Partitioner(fixture.coordinator, group, host, partitions), fixture.coordinator
def setUp(self): super(TestLeaderElection, self).setUp() self.coord_fixture = self.useFixture( fixtures.CoordinatorFixture('zake://', b'InsertNameHere')) self.election = coordination.LeaderElection(self.coordinator, 'President')