示例#1
0
 def testMultiPSScript(self, psscript):
     """Valid inputs should call PSScript with the appropriate args."""
     powershell.MultiPSScript([[SCRIPT], [SCRIPT]], self.bi).Run()
     psscript.assert_has_calls(
         [mock.call([SCRIPT], self.bi),
          mock.call([SCRIPT], self.bi)],
         any_order=True)
示例#2
0
 def testMultiPSScriptValidateArgsType(self):
     """Non-list args should raise ValidationError."""
     with self.assertRaises(powershell.ValidationError):
         powershell.MultiPSScript([[SCRIPT], SCRIPT], self.bi).Validate()
示例#3
0
 def testMultiPSScriptValidateError(self):
     """String input should raise ValidationError."""
     with self.assertRaises(powershell.ActionError):
         powershell.MultiPSScript(SCRIPT, self.bi).Validate()
示例#4
0
 def testMultiPSScriptValidate(self):
     """Valid inputs should pass validation tests."""
     powershell.MultiPSScript([[SCRIPT]], self.bi).Validate()
示例#5
0
 def testMultiPSScriptIndexError(self):
     """Missing input fields should raise IndexError."""
     with self.assertRaises(powershell.ActionError):
         powershell.MultiPSScript([[]], self.bi).Run()