Exemplo n.º 1
0
 def test_catches_bad_argv(self):
     with mock.patch.object(logging, 'error') as mock_logging,\
         mock.patch.object(sys, 'exit') as mock_exit:
         call_variants.main(['call_variants.py', 'extra_arg'])
     mock_logging.assert_called_once_with(
         'Command line parsing failure: call_variants does not accept '
         'positional arguments but some are present on the command line: '
         '"[\'call_variants.py\', \'extra_arg\']".')
     mock_exit.assert_called_once_with(errno.ENOENT)
Exemplo n.º 2
0
 def test_catches_bad_argv(self):
   with mock.patch.object(logging, 'error') as mock_logging,\
       mock.patch.object(sys, 'exit') as mock_exit:
     call_variants.main(['call_variants.py', 'extra_arg'])
   mock_logging.assert_called_once_with(
       'Command line parsing failure: call_variants does not accept '
       'positional arguments but some are present on the command line: '
       '"[\'call_variants.py\', \'extra_arg\']".')
   mock_exit.assert_called_once_with(errno.ENOENT)