def test_summary_all_props_table(self): oh = tbls.create_observation_history(self.metadata) sh = tbls.create_slew_history(self.metadata) sfs = tbls.create_slew_final_state(self.metadata) ph = tbls.create_observation_proposal_history(self.metadata) p = tbls.create_proposal(self.metadata) f = tbls.create_field(self.metadata) summary = tbls.create_summary_all_props(self.metadata, oh, sh, sfs, p, ph, f) self.assertEqual(len(summary.c), 36)
def test_write_observation_proposal_history_table(self): phist = topic_helpers.obs_prop_hist result = tbls.write_observation_proposal_history(phist, 1001) prop_hist = tbls.create_observation_proposal_history(self.metadata) self.check_ordered_dict_to_table(result, prop_hist) self.assertEqual(result['propHistId'], phist[0]) self.assertEqual(result['Proposal_propId'], phist[1]) self.assertEqual(result['proposalValue'], phist[2]) self.assertEqual(result['proposalNeed'], phist[3]) self.assertEqual(result['proposalBonus'], phist[4]) self.assertEqual(result['proposalBoost'], phist[5]) self.assertEqual(result['ObsHistory_observationId'], phist[6]) self.assertEqual(result['Session_sessionId'], 1001)
def test_create_observation_proposal_history_table(self): prop_hist = tbls.create_observation_proposal_history(self.metadata) self.assertEqual(len(prop_hist.c), 8) self.assertEqual(len(prop_hist.indexes), 1)