text: import unittest
  import sys
  sys.path.append('..')
  
  from engineering_tool.pressures import *
  
  class TestPressure(unittest.TestCase):
  
      def test_pressureConvert(self):
          self.assertAlmostEqual(Pressure.BarToPascal(0),0)
          self.assertAlmostEqual(Pressure.BarToPascal(1),a)
          self.assertAlmostEqual(Pressure.BarToPascal(100.5),100.5 * a)
          self.assertAlmostEqual(Pressure.AtmToPascal(0),0)
          self.assertAlmostEqual(Pressure.AtmToPascal(1),b)
          self.assertAlmostEqual(Pressure.AtmToPascal(100.5),100.5 * b)
          self.assertAlmostEqual(Pressure.TorrToPascal(0),0)
          self.assertAlmostEqual(Pressure.TorrToPascal(1),b/c)
          self.assertAlmostEqual(Pressure.TorrToPascal(100.5),100.5 * (b/c))
          self.assertAlmostEqual(Pressure.mmHgToPascal(0),0)
          self.assertAlmostEqual(Pressure.mmHgToPascal(1),d*e)
          self.assertAlmostEqual(Pressure.mmHgToPascal(100.5),100.5 * d*e)
  
          self.assertAlmostEqual(Pressure.PascalToBar(0),0)
          self.assertAlmostEqual(Pressure.PascalToBar(1),1/a)
          self.assertAlmostEqual(Pressure.PascalToBar(100.5),100.5 *(1/a) )
          self.assertAlmostEqual(Pressure.AtmToBar(0),0)
          self.assertAlmostEqual(Pressure.AtmToBar(1),b/a)
          self.assertAlmostEqual(Pressure.AtmToBar(100.5),100.5 * (b/a))
          self.assertAlmostEqual(Pressure.TorrToBar(0),0)
          self.assertAlmostEqual(Pressure.TorrToBar(1),b/(a*c))
          self.assertAlmostEqual(Pressure.TorrToBar(100.5),100.5 * (b/(a*c)))
          self.assertAlmostEqual(Pressure.mmHgToBar(0),0)
          self.assertAlmostEqual(Pressure.mmHgToBar(1),(d*e)/a)
          self.assertAlmostEqual(Pressure.mmHgToBar(100.5),100.5 * ((d*e)/a))
  
          self.assertAlmostEqual(Pressure.PascalToAtm(0),0)
          self.assertAlmostEqual(Pressure.PascalToAtm(1),1/b)
          self.assertAlmostEqual(Pressure.PascalToAtm(100.5),100.5 *(1/b) )
          self.assertAlmostEqual(Pressure.BarToAtm(0),0)
          self.assertAlmostEqual(Pressure.BarToAtm(1),a/b)
          self.assertAlmostEqual(Pressure.BarToAtm(100.5),100.5 * (a/b))
          self.assertAlmostEqual(Pressure.TorrToAtm(0),0)
          self.assertAlmostEqual(Pressure.TorrToAtm(1),1/c)
          self.assertAlmostEqual(Pressure.TorrToAtm(100.5),100.5 * (1/c))
          self.assertAlmostEqual(Pressure.mmHgToAtm(0),0)
          self.assertAlmostEqual(Pressure.mmHgToAtm(1),(d*e)/b)
          self.assertAlmostEqual(Pressure.mmHgToAtm(100.5),100.5 * ((d*e)/b))
  
          self.assertAlmostEqual(Pressure.PascalToTorr(0),0)
          self.assertAlmostEqual(Pressure.PascalToTorr(1),c/b)
          self.assertAlmostEqual(Pressure.PascalToTorr(100.5),100.5 *(c/b) )
          self.assertAlmostEqual(Pressure.BarToTorr(0),0)
          self.assertAlmostEqual(Pressure.BarToTorr(1),(a*c)/b)
          self.assertAlmostEqual(Pressure.BarToTorr(100.5),100.5 * ((a*c)/b))
          self.assertAlmostEqual(Pressure.AtmToTorr(0),0)
          self.assertAlmostEqual(Pressure.AtmToTorr(1),c)
          self.assertAlmostEqual(Pressure.AtmToTorr(100.5),100.5 * c)
          self.assertAlmostEqual(Pressure.mmHgToTorr(0),0)
          self.assertAlmostEqual(Pressure.mmHgToTorr(1),(c*d*e)/b)
          self.assertAlmostEqual(Pressure.mmHgToTorr(100.5),100.5 * ((c*d*e)/b))
  
          self.assertAlmostEqual(Pressure.PascalTommHg(0),0)
          self.assertAlmostEqual(Pressure.PascalTommHg(1),1/(d*e))
          self.assertAlmostEqual(Pressure.PascalTommHg(100.5),100.5 *(1/(d*e)) )
          self.assertAlmostEqual(Pressure.BarTommHg(0),0)
          self.assertAlmostEqual(Pressure.BarTommHg(1),a/(d*e))
          self.assertAlmostEqual(Pressure.BarTommHg(100.5),100.5 * (a/(d*e)))
          self.assertAlmostEqual(Pressure.AtmTommHg(0),0)
          self.assertAlmostEqual(Pressure.AtmTommHg(1),b/(e*d))
          self.assertAlmostEqual(Pressure.AtmTommHg(100.5),100.5 * (b/(d*e)))
          self.assertAlmostEqual(Pressure.TorrTommHg(0),0)
          self.assertAlmostEqual(Pressure.TorrTommHg(1),b/(c*d*e))
          self.assertAlmostEqual(Pressure.TorrTommHg(100.5),100.5 * (b/(c*d*e)))
  
          self.assertAlmostEqual(Pressure.PsiToPascal(0),0)
          self.assertAlmostEqual(Pressure.PsiToPascal(1),6894.8)
          self.assertAlmostEqual(Pressure.PsiToPascal(100.5),100.5 * 6894.8 )
          self.assertAlmostEqual(Pressure.PsiToBar(0),0)
          self.assertAlmostEqual(Pressure.PsiToBar(1),6.8948/100)
          self.assertAlmostEqual(Pressure.PsiToBar(100.5),100.5 * (6.8948/100))
          self.assertAlmostEqual(Pressure.PsiToAtm(0),0)
          self.assertAlmostEqual(Pressure.PsiToAtm(1),6.8046/100)
          self.assertAlmostEqual(Pressure.PsiToAtm(100.5),100.5 * (6.8046/100))
          self.assertAlmostEqual(Pressure.PsiToTorr(0),0)
          self.assertAlmostEqual(Pressure.PsiToTorr(1),51.71493)
          self.assertAlmostEqual(Pressure.PsiToTorr(100.5),100.5 * 51.71493)
  
          self.assertAlmostEqual(Pressure.PascalToPsi(0),0)
          self.assertAlmostEqual(Pressure.PascalToPsi(1),(1.450377/10000))
          self.assertAlmostEqual(Pressure.PascalToPsi(100.5),100.5 * (1.450377/10000))
          self.assertAlmostEqual(Pressure.BarToPsi(0),0)
          self.assertAlmostEqual(Pressure.BarToPsi(1),14.50377)
          self.assertAlmostEqual(Pressure.BarToPsi(100.5),100.5 * 14.50377)
          self.assertAlmostEqual(Pressure.AtmToPsi(0),0)
          self.assertAlmostEqual(Pressure.AtmToPsi(1),14.69595)
          self.assertAlmostEqual(Pressure.AtmToPsi(100.5),100.5 * 14.69595)
          self.assertAlmostEqual(Pressure.TorrToPsi(0),0)
          self.assertAlmostEqual(Pressure.TorrToPsi(1),(1.933678/100))
          self.assertAlmostEqual(Pressure.TorrToPsi(100.5),100.5 * (1.933678/100))
  
      def test_pressureConvertType(self):
          self.assertRaises(TypeError,Pressure.BarToPascal,2+2j)
          self.assertRaises(TypeError,Pressure.BarToPascal,True)
          self.assertRaises(TypeError,Pressure.BarToPascal,"Bar")
          self.assertRaises(TypeError,Pressure.AtmToPascal,2+2j)
          self.assertRaises(TypeError,Pressure.AtmToPascal,True)
          self.assertRaises(TypeError,Pressure.AtmToPascal,"Atm")
          self.assertRaises(TypeError,Pressure.TorrToPascal,2+2j)
          self.assertRaises(TypeError,Pressure.TorrToPascal,True)
          self.assertRaises(TypeError,Pressure.TorrToPascal,"Torr")
          self.assertRaises(TypeError,Pressure.mmHgToPascal,2+2j)
          self.assertRaises(TypeError,Pressure.mmHgToPascal,True)
          self.assertRaises(TypeError,Pressure.mmHgToPascal,"mmHg")
  
          self.assertRaises(TypeError,Pressure.PascalToBar,2+2j)
          self.assertRaises(TypeError,Pressure.PascalToBar,True)
          self.assertRaises(TypeError,Pressure.PascalToBar,"Pascal")
          self.assertRaises(TypeError,Pressure.AtmToBar,2+2j)
          self.assertRaises(TypeError,Pressure.AtmToBar,True)
          self.assertRaises(TypeError,Pressure.AtmToBar,"Atm")
          self.assertRaises(TypeError,Pressure.TorrToBar,2+2j)
          self.assertRaises(TypeError,Pressure.TorrToBar,True)
          self.assertRaises(TypeError,Pressure.TorrToBar,"Torr")
          self.assertRaises(TypeError,Pressure.mmHgToBar,2+2j)
          self.assertRaises(TypeError,Pressure.mmHgToBar,True)
          self.assertRaises(TypeError,Pressure.mmHgToBar,"mmHg")
  
          self.assertRaises(TypeError,Pressure.PascalToAtm,2+2j)
          self.assertRaises(TypeError,Pressure.PascalToAtm,True)
          self.assertRaises(TypeError,Pressure.PascalToAtm,"Pascal")
          self.assertRaises(TypeError,Pressure.BarToAtm,2+2j)
          self.assertRaises(TypeError,Pressure.BarToAtm,True)
          self.assertRaises(TypeError,Pressure.BarToAtm,"Atm")
          self.assertRaises(TypeError,Pressure.TorrToAtm,2+2j)
          self.assertRaises(TypeError,Pressure.TorrToAtm,True)
          self.assertRaises(TypeError,Pressure.TorrToAtm,"Torr")
          self.assertRaises(TypeError,Pressure.mmHgToAtm,2+2j)
          self.assertRaises(TypeError,Pressure.mmHgToAtm,True)
          self.assertRaises(TypeError,Pressure.mmHgToAtm,"mmHg")
  
          self.assertRaises(TypeError,Pressure.PascalToTorr,2+2j)
          self.assertRaises(TypeError,Pressure.PascalToTorr,True)
          self.assertRaises(TypeError,Pressure.PascalToTorr,"Pascal")
          self.assertRaises(TypeError,Pressure.BarToTorr,2+2j)
          self.assertRaises(TypeError,Pressure.BarToTorr,True)
          self.assertRaises(TypeError,Pressure.BarToTorr,"Atm")
          self.assertRaises(TypeError,Pressure.AtmToTorr,2+2j)
          self.assertRaises(TypeError,Pressure.AtmToTorr,True)
          self.assertRaises(TypeError,Pressure.AtmToTorr,"Torr")
          self.assertRaises(TypeError,Pressure.mmHgToTorr,2+2j)
          self.assertRaises(TypeError,Pressure.mmHgToTorr,True)
          self.assertRaises(TypeError,Pressure.mmHgToTorr,"mmHg")
  
          self.assertRaises(TypeError,Pressure.PascalTommHg,2+2j)
          self.assertRaises(TypeError,Pressure.PascalTommHg,True)
          self.assertRaises(TypeError,Pressure.PascalTommHg,"Pascal")
          self.assertRaises(TypeError,Pressure.BarTommHg,2+2j)
          self.assertRaises(TypeError,Pressure.BarTommHg,True)
          self.assertRaises(TypeError,Pressure.BarTommHg,"Atm")
          self.assertRaises(TypeError,Pressure.AtmTommHg,2+2j)
          self.assertRaises(TypeError,Pressure.AtmTommHg,True)
          self.assertRaises(TypeError,Pressure.AtmTommHg,"Torr")
          self.assertRaises(TypeError,Pressure.TorrTommHg,2+2j)
          self.assertRaises(TypeError,Pressure.TorrTommHg,True)
          self.assertRaises(TypeError,Pressure.TorrTommHg,"mmHg")
  
          self.assertRaises(TypeError,Pressure.PsiToPascal,2+2j)
          self.assertRaises(TypeError,Pressure.PsiToPascal,True)
          self.assertRaises(TypeError,Pressure.PsiToPascal,"Pascal")
          self.assertRaises(TypeError,Pressure.PsiToBar,2+2j)
          self.assertRaises(TypeError,Pressure.PsiToBar,True)
          self.assertRaises(TypeError,Pressure.PsiToBar,"Atm")
          self.assertRaises(TypeError,Pressure.PsiToAtm,2+2j)
          self.assertRaises(TypeError,Pressure.PsiToAtm,True)
          self.assertRaises(TypeError,Pressure.PsiToAtm,"Torr")
          self.assertRaises(TypeError,Pressure.PsiToTorr,2+2j)
          self.assertRaises(TypeError,Pressure.PsiToTorr,True)
          self.assertRaises(TypeError,Pressure.PsiToTorr,"mmHg")
  
          self.assertRaises(TypeError,Pressure.PascalToPsi,2+2j)
          self.assertRaises(TypeError,Pressure.PascalToPsi,True)
          self.assertRaises(TypeError,Pressure.PascalToPsi,"Pascal")
          self.assertRaises(TypeError,Pressure.BarToPsi,2+2j)
          self.assertRaises(TypeError,Pressure.BarToPsi,True)
          self.assertRaises(TypeError,Pressure.BarToPsi,"Atm")
          self.assertRaises(TypeError,Pressure.AtmToPsi,2+2j)
          self.assertRaises(TypeError,Pressure.AtmToPsi,True)
          self.assertRaises(TypeError,Pressure.AtmToPsi,"Torr")
          self.assertRaises(TypeError,Pressure.TorrToPsi,2+2j)
          self.assertRaises(TypeError,Pressure.TorrToPsi,True)
          self.assertRaises(TypeError,Pressure.TorrToPsi,"mmHg")
      
      def test_pressure(self):
          self.assertAlmostEqual(Pressure.ForceAndArea(0,1),0)
          self.assertAlmostEqual(Pressure.ForceAndArea(2.5,10.7),2.5/10.7)
  
          self.assertAlmostEqual(Pressure.EnergyAndVolume(0,1),0)
          self.assertAlmostEqual(Pressure.EnergyAndVolume(2.5,10.7),2.5/10.7)
  
          self.assertAlmostEqual(Pressure.Gas(1,0,0,0),0)
          self.assertAlmostEqual(Pressure.Gas(2,2,2,2),(2*2*2)/2)
  
          self.assertAlmostEqual(Pressure.KineticMass(1,0,1),0)
          self.assertAlmostEqual(Pressure.KineticMass(1,1,1),0.5)
  
          self.assertAlmostEqual(Pressure.KineticRho(1,1),0.5)
  
          self.assertAlmostEqual(Pressure.PotentialMass(1,1,1),g)
  
          self.assertAlmostEqual(Pressure.PotentialRho(1,1),g)
      
      def test_pressureValue(self):
          self.assertRaises(ValueError,Pressure.Gas,-1,1,1,1)
          self.assertRaises(ValueError,Pressure.Gas,1,-1,1,1)
          self.assertRaises(ValueError,Pressure.Gas,1,1,-1,1)
  
          self.assertRaises(ValueError,Pressure.KineticMass,-1,1,1)
          self.assertRaises(ValueError,Pressure.KineticMass,1,-1,1)
          self.assertRaises(ValueError,Pressure.KineticMass,1,1,-1)
  
          self.assertRaises(ValueError,Pressure.KineticRho,-1,1)
          self.assertRaises(ValueError,Pressure.KineticRho,1,-1)
  
          self.assertRaises(ValueError,Pressure.PotentialMass,-1,1,1)
          self.assertRaises(ValueError,Pressure.PotentialMass,1,-1,1)
          self.assertRaises(ValueError,Pressure.PotentialMass,1,1,-1)
  
          self.assertRaises(ValueError,Pressure.PotentialRho,-1,1)
          self.assertRaises(ValueError,Pressure.PotentialRho,1,-1)
      
      def test_pressureType(self):
          self.assertRaises(TypeError,Pressure.Gas,2+2j,2,2,2)
          self.assertRaises(TypeError,Pressure.Gas,2,2+2j,2,2)
          self.assertRaises(TypeError,Pressure.Gas,2,2,2+2j,2)
          self.assertRaises(TypeError,Pressure.Gas,2,2,2,2+2j)
          self.assertRaises(TypeError,Pressure.Gas,True,2,2,2)
          self.assertRaises(TypeError,Pressure.Gas,2,True,2,2)
          self.assertRaises(TypeError,Pressure.Gas,2,2,True,2)
          self.assertRaises(TypeError,Pressure.Gas,2,2,2,True)
          self.assertRaises(TypeError,Pressure.Gas,"V",2,2,2)
          self.assertRaises(TypeError,Pressure.Gas,2,"n",2,2)
          self.assertRaises(TypeError,Pressure.Gas,2,2,"R",2)
          self.assertRaises(TypeError,Pressure.Gas,2,2,2,"T")
  
          self.assertRaises(TypeError,Pressure.KineticMass,2+2j,2,2)
          self.assertRaises(TypeError,Pressure.KineticMass,2,2+2j,2)
          self.assertRaises(TypeError,Pressure.KineticMass,2,2,2+2j)
          self.assertRaises(TypeError,Pressure.KineticMass,True,2,2)
          self.assertRaises(TypeError,Pressure.KineticMass,2,True,2)
          self.assertRaises(TypeError,Pressure.KineticMass,2,2,True)
          self.assertRaises(TypeError,Pressure.KineticMass,"V",2,2)
          self.assertRaises(TypeError,Pressure.KineticMass,2,"v",2)
          self.assertRaises(TypeError,Pressure.KineticMass,2,2,"m")
  
          self.assertRaises(TypeError,Pressure.KineticRho,2+2j,2)
          self.assertRaises(TypeError,Pressure.KineticRho,2,2+2j)
          self.assertRaises(TypeError,Pressure.KineticRho,True,2)
          self.assertRaises(TypeError,Pressure.KineticRho,2,True)
          self.assertRaises(TypeError,Pressure.KineticRho,"v",2)
          self.assertRaises(TypeError,Pressure.KineticRho,2,"rho")
  
          self.assertRaises(TypeError,Pressure.PotentialMass,2+2j,2,2)
          self.assertRaises(TypeError,Pressure.PotentialMass,2,2+2j,2)
          self.assertRaises(TypeError,Pressure.PotentialMass,2,2,2+2j)
          self.assertRaises(TypeError,Pressure.PotentialMass,True,2,2)
          self.assertRaises(TypeError,Pressure.PotentialMass,2,True,2)
          self.assertRaises(TypeError,Pressure.PotentialMass,2,2,True)
          self.assertRaises(TypeError,Pressure.PotentialMass,"V",2,2)
          self.assertRaises(TypeError,Pressure.PotentialMass,2,"m",2)
          self.assertRaises(TypeError,Pressure.PotentialMass,2,2,"H")
  
          self.assertRaises(TypeError,Pressure.PotentialRho,2+2j,2)
          self.assertRaises(TypeError,Pressure.PotentialRho,2,2+2j)
          self.assertRaises(TypeError,Pressure.PotentialRho,True,2)
          self.assertRaises(TypeError,Pressure.PotentialRho,2,True)
          self.assertRaises(TypeError,Pressure.PotentialRho,"rho",2)
          self.assertRaises(TypeError,Pressure.PotentialRho,2,"H")
  
  
          
  
  
  
          
  