示例#1
0
 def test_no_cmd_provided(self):
     with self.assertOutputMatches(exit_status='2', stderr='stor: error:.*arguments'):
         with mock.patch.object(sys, 'argv', ['stor']):
             cli.main()
示例#2
0
 def parse_args(self, args):
     with mock.patch.object(sys, 'argv', args.split()):
         cli.main()
示例#3
0
文件: test_cli.py 项目: jdavisp3/stor
 def test_no_cmd_provided(self):
     with mock.patch.object(sys, 'argv', ['stor']):
         with self.assertRaisesRegexp(SystemExit, '2'):
             cli.main()
     self.assertIn('stor: error:', sys.stderr.getvalue())
     self.assertIn('arguments', sys.stderr.getvalue())