Ejemplo n.º 1
0
 def testMultiPSCommand(self, pscommand):
     """Valid inputs should call PSCommand with the appropriate args."""
     powershell.MultiPSCommand([[COMMAND], [COMMAND]], self.bi).Run()
     pscommand.assert_has_calls(
         [mock.call([COMMAND], self.bi),
          mock.call([COMMAND], self.bi)],
         any_order=True)
Ejemplo n.º 2
0
 def testMultiPSCommandValidateArgsType(self):
     """Non-list args should raise ValidationError."""
     with self.assertRaises(powershell.ValidationError):
         powershell.MultiPSCommand([[COMMAND], COMMAND], self.bi).Validate()
Ejemplo n.º 3
0
 def testMultiPSCommandValidateType(self):
     """String input should raise ValidationError."""
     with self.assertRaises(powershell.ActionError):
         powershell.MultiPSCommand(COMMAND, self.bi).Validate()
Ejemplo n.º 4
0
 def testMultiPSCommandValidate(self):
     """Valid inputs should pass validation tests."""
     powershell.MultiPSCommand([[COMMAND]], self.bi).Validate()
Ejemplo n.º 5
0
 def testMultiPSCommandIndexError(self):
     """Missing input fields should raise IndexError."""
     with self.assertRaises(powershell.ActionError):
         powershell.MultiPSCommand([[]], self.bi).Run()