def test_use_sys_args(self): """Use sys.argv and raise if main is called without args.""" sys.argv = [] with self.assertRaises(SystemExit): cli.main()
def test_print_url_gets_called(self, print_mock): """Print URL, if option ``-e`` is not given.""" args = "TestTask".split() cli.main(args) print_mock.assert_called_with(self.url)
def test_missing_args_raise_system_exit(self): """Raise SystemExit, if args are missing.""" with self.assertRaises(SystemExit): cli.main([])
def test_openwebbrowser_gets_called_long_option(self, web_mock): """Call webbrowser, if option ``--execute`` is given.""" args = "TestTask --execute".split() cli.main(args) web_mock.assert_called_with(self.url)