def testMultiParam(self): args = "gmx_mpi mdrun -noconfout -ntmpi 4 -maxh 2.1 -pme cpu" expected = { "ntmpi": 4, "pme": "cpu", "maxh": 2.1, "noconfout": True } self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), expected)
def testStrParam(self): args = "gmx mdrun -nb gpu" self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"nb": "gpu"})
def testBoolParam(self): args = "gmx mdrun -noconfout" self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"noconfout": True})
def testFloatParam(self): args = "gmx mdrun -maxh 3.0" self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"maxh": 3.0})
def testIntParam(self): args = "gmx mdrun -ntomp 5" self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"ntomp": 5})
def testInvalid(self): args = "gmx mdrun -maxh blah" with self.assertRaises(ParseGmxCommandError): _commandInputRegexOp(self._combineArgs(args))
def testEmptyParam(self): args = "gmx mdrun" self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {})
def testNoVal(self): self.assertIsNone(_commandInputRegexOp(self.pre_garbage + self.post_garbage))