예제 #1
0
 def main(self):
     """Perform various checks on the `TeamParticipation` table."""
     if self.options.load_info:
         participation_info = load_bz2_pickle(self.options.load_info)
     else:
         check_teamparticipation_circular(self.logger)
         participation_info = fetch_team_participation_info(self.logger)
     if self.options.save_info:
         save_bz2_pickle(participation_info, self.options.save_info)
     else:
         errors = check_teamparticipation_consistency(
             self.logger, participation_info)
         fix_teamparticipation_consistency(self.logger, errors)
 def main(self):
     """Perform various checks on the `TeamParticipation` table."""
     if self.options.load_info:
         participation_info = load_bz2_pickle(self.options.load_info)
     else:
         check_teamparticipation_circular(self.logger)
         participation_info = fetch_team_participation_info(self.logger)
     if self.options.save_info:
         save_bz2_pickle(participation_info, self.options.save_info)
     else:
         errors = check_teamparticipation_consistency(
             self.logger, participation_info)
         fix_teamparticipation_consistency(self.logger, errors)
예제 #3
0
 def test_save_and_load(self):
     data = {1: 2, "room": 101}
     tempdir = self.useFixture(TempDir()).path
     tempfile = os.path.join(tempdir, "dump")
     save_bz2_pickle(data, tempfile)
     self.assertEqual(data, load_bz2_pickle(tempfile))
예제 #4
0
 def test_save_and_load(self):
     data = {1: 2, "room": 101}
     tempdir = self.useFixture(TempDir()).path
     tempfile = os.path.join(tempdir, "dump")
     save_bz2_pickle(data, tempfile)
     self.assertEqual(data, load_bz2_pickle(tempfile))