def test_save_file_existing(self): '''test case test_save_file_existing''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) labfile.set_parm_value("L80", "2345") labfile.save_file() newfile = lab_file.LabFile() newfile.parse_file(self.lab_filename) self.assertEqual(newfile.get_parm_value("L80"), "2345")
def test_save_file_new(self): '''test case test_save_file_new''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) labfile.set_parm_value("L80", "2345") labfile.set_parm_value("999", "999") labfile.save_file("test2file") newfile = lab_file.LabFile() newfile.parse_file("test2file") self.assertEqual(newfile.get_parm_value("L80"), "2345") self.assertEqual(newfile.get_parm_value("999"), "999") if os.path.exists("test2file"): os.remove("test2file")
def test_set_parm_description(self): '''test case test_set_parm_description''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) value = labfile.get_parm_value("L80") labfile.set_parm_value("L80", value, "new description") self.assertEqual(labfile.get_parm_description("L80"), "new description")
def test_set_new_parm_value(self): '''test case test_set_new_parm_value''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) labfile.set_parm_value("999", "999") self.assertEqual(labfile.get_parm_value("999"), "999")
def test_bad_float_value(self): '''test case test_bad_float_value''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) self.assertEqual(labfile.get_float_value("L90"), 0.0)
def test_dry_value(self): '''test case test_dry_value''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) self.assertEqual(labfile.get_dry_value("110"), "11.24903026")
def test_get_desciption(self): '''test case test_get_description''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) self.assertEqual(labfile.get_parm_description("060"), "Base Curve____________________")
def test_string_value(self): '''test case test_string_value''' labfile = lab_file.LabFile() labfile.parse_file(self.lab_filename) self.assertEqual(labfile.get_parm_value("A10"), "03110153")