Example #1
0
 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")
Example #2
0
 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")
Example #3
0
 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")
Example #4
0
 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")
Example #5
0
 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)
Example #6
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")
Example #7
0
 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____________________")
Example #8
0
 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")