def test_update_experiment_and_get(self): exp = Experiment('expid8', 'test_experiment', 'unittest', 10, None, 1, 'running') self.db.save_experiment(exp) self.assertEqual(self.db.get_experiment('expid8').status, 'running') self.assertEqual(self.db.get_experiment('expid8').end, None) exp.status = 'finished' exp.end = 100 self.db.update_experiment(exp) self.assertEqual(self.db.get_experiment('expid8').status, 'finished') self.assertEqual(self.db.get_experiment('expid8').end, 100)
def finalize_experiment(self, exp: Experiment, status): exp.status = status exp.end = time.time() self.update_experiment(exp) self.touch_traces(exp)