def test_serialize_small(self): data = HAZARD_CURVE_DATA(['1_1', '1_2', '2_2', '2'], 20, 4) self.job = self.setup_classic_job() output_path = self.generate_output_path(self.job) for i in xrange(0, 10): hcw = HazardCurveDBWriter(output_path + str(i), self.job.id) # Call the function under test. hcw.serialize(data)
def test_deserialize_small(self): data = HAZARD_CURVE_DATA(['1_1', '1_2', '2_2', '2'], 20, 4) self.job = self.setup_classic_job() output_path = self.generate_output_path(self.job) hcw = HazardCurveDBWriter(output_path, self.job.id) hcw.serialize(data) # deserialize hcr = HazardCurveDBReader() for i in xrange(0, 10): # Call the function under test. hcr.deserialize(hcw.output.id)