示例#1
0
def grr_set_flow_timeout(line: Text) -> None:
    """Sets flow timeout.

  Specifying 0 as timeout means not to wait.

  Args:
    line: A string representing arguments passed to the magic command.

  Returns:
    Nothing.
  """
    args = grr_set_flow_timeout.parser.parse_args(shlex.split(line))
    magics_impl.grr_set_flow_timeout_impl(args.timeout)
示例#2
0
 def testNegativeValueError(self):
     with mock.patch.object(_timeout, '_FLOW_TIMEOUT', 30):
         with self.assertRaises(ValueError):
             magics_impl.grr_set_flow_timeout_impl(-10)
示例#3
0
 def testNonZero(self):
     with mock.patch.object(_timeout, '_FLOW_TIMEOUT', 30):
         magics_impl.grr_set_flow_timeout_impl(10)
         self.assertEqual(_timeout._FLOW_TIMEOUT, 10)