def test_save_improper_formula_no_data(self): record = Calculation.save(self.dataset, 'NON_EXISTENT_COLUMN', self.name) self.assertTrue(isinstance(record, dict)) self.assertTrue(ERROR in record.keys()) self.assertTrue('Missing column' in record[ERROR].__str__())
def test_save_unparsable_formula_no_data(self): record = Calculation.save(self.dataset, '=NON_EXISTENT_COLUMN', self.name) self.assertTrue(isinstance(record, dict)) self.assertTrue(ERROR in record.keys()) self.assertTrue('Parse Failure' in record[ERROR].__str__())
def _save_observations_and_calculation(self, formula=None): if not formula: formula = self.formula Observation.save(self.test_data['good_eats.csv'], self.dataset) return Calculation.save(self.dataset, formula, self.name)