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()
def parse_args(self, args): with mock.patch.object(sys, 'argv', args.split()): cli.main()
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())