def teardown(self): target_mirror = (self.left.mirror | self.right.mirror) - ( (self.original.mirror - self.left.mirror) | (self.original.mirror - self.right.mirror) ) n_inserts = len(self.right.mirror - self.left.mirror - self.original.mirror) n_deletes = len((self.original.mirror - self.right.mirror) & self.left.mirror) result = merge_dbs(self.original.connection(), self.left.connection(), self.right.connection()) assert result.inserts == n_inserts assert result.deletes == n_deletes self.left.refresh_mirror() self.original.close() self.left.close() self.right.close() assert self.left.mirror == target_mirror
def teardown(self): target_mirror = (self.left.mirror | self.right.mirror) - ( (self.original.mirror - self.left.mirror) | (self.original.mirror - self.right.mirror)) n_inserts = len(self.right.mirror - self.left.mirror - self.original.mirror) n_deletes = len((self.original.mirror - self.right.mirror) & self.left.mirror) result = merge_dbs(self.original.connection(), self.left.connection(), self.right.connection()) assert result.inserts == n_inserts assert result.deletes == n_deletes self.left.refresh_mirror() self.original.close() self.left.close() self.right.close() assert self.left.mirror == target_mirror