Esempio n. 1
0
    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)
Esempio n. 2
0
 def testStrParam(self):
     args = "gmx mdrun -nb gpu"
     self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"nb": "gpu"})
Esempio n. 3
0
 def testBoolParam(self):
     args = "gmx mdrun -noconfout"
     self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"noconfout": True})
Esempio n. 4
0
 def testFloatParam(self):
     args = "gmx mdrun -maxh 3.0"
     self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"maxh": 3.0})
Esempio n. 5
0
 def testIntParam(self):
     args = "gmx mdrun -ntomp 5"
     self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {"ntomp": 5})
Esempio n. 6
0
 def testInvalid(self):
     args = "gmx mdrun -maxh blah"
     with self.assertRaises(ParseGmxCommandError):
         _commandInputRegexOp(self._combineArgs(args))
Esempio n. 7
0
 def testEmptyParam(self):
     args = "gmx mdrun"
     self.assertDictEqual(_commandInputRegexOp(self._combineArgs(args)), {})
Esempio n. 8
0
 def testNoVal(self):
     self.assertIsNone(_commandInputRegexOp(self.pre_garbage + self.post_garbage))