Пример #1
0
 def test_valid_run_no_tgt_pressure_gives_correct_tws(self):
     d = 2.1
     temp = 300
     LeadPressureCalc(d, temp)
     ws = mtd['LeadPressureCalcResults']
     self.assertEqual(len(ws.toDict().keys()), 6)
     self.assertAlmostEqual(ws.row(0)["Calculated Pressure (GPa)"], ws.row(0)["Pressure Target (GPa)"], 7)
Пример #2
0
 def test_valid_run_with_bad_tgt_pressure_gives_correct_tws(self):
     d = 2.1
     temp = 300
     tgt_p = 123456
     LeadPressureCalc(d, temp, tgt_p)
     ws = mtd['LeadPressureCalcResults']
     self.assertEqual(len(ws.toDict().keys()), 3)
     self.assertNotIn("Pressure Target (GPa)", ws.row(0).keys())
Пример #3
0
 def test_valid_run_with_tgt_pressure_gives_correct_tws(self):
     d = 2.1
     temp = 300
     tgt_p = 0.000123
     LeadPressureCalc(d, temp, tgt_p)
     ws = mtd['LeadPressureCalcResults']
     self.assertEqual(len(ws.toDict().keys()), 6)
     self.assertAlmostEqual(tgt_p, ws.row(0)["Pressure Target (GPa)"], 7)
Пример #4
0
 def test_high_t_low_d(self):
     d = 2.635
     temp = 490
     LeadPressureCalc(d, temp)
     ws = mtd['LeadPressureCalcResults']
     self.assertAlmostEqual(20.274, ws.row(0)["Calculated Pressure (GPa)"], 1)  # calc err +- 2.426
Пример #5
0
 def test_high_d_low_t(self):
     d = 2.865
     temp = 385
     LeadPressureCalc(d, temp)
     ws = mtd['LeadPressureCalcResults']
     self.assertAlmostEqual(0.048, ws.row(0)["Calculated Pressure (GPa)"], 3)
Пример #6
0
 def test_valid_run_produces_table_ws(self):
     d = 2.1
     temp = 300
     LeadPressureCalc(d, temp)
     self.assertIn('LeadPressureCalcResults', mtd)