def test_eodag_search_without_args(self): """Calling eodag search subcommand without arguments should print help message and return error code""" # noqa result = self.runner.invoke(eodag, ["search"]) with click.Context(search_crunch) as ctx: self.assertEqual( no_blanks(result.output), no_blanks("".join(( "Give me some work to do. See below for how to do that:", ctx.get_help(), ))), ) self.assertNotEqual(result.exit_code, 0)
def test_eodag_download_no_search_results_arg(self): """Calling eodag download without a path to a search result should fail""" result = self.runner.invoke(eodag, ["download"]) with click.Context(download) as ctx: self.assertEqual( no_blanks(result.output), no_blanks("".join(( "Nothing to do (no search results file provided)", ctx.get_help(), ))), ) self.assertEqual(result.exit_code, 1)
def test_eodag_search_without_producttype_arg(self): """Calling eodag search without -p | --productType should print the help message and return error code""" # noqa start_date = self.faker.date() end_date = self.faker.date() result = self.runner.invoke( eodag, ["search", "-s", start_date, "-e", end_date]) with click.Context(search_crunch) as ctx: self.assertEqual( no_blanks(result.output), no_blanks("".join(( "Give me some work to do. See below for how to do that:", ctx.get_help(), ))), ) self.assertNotEqual(result.exit_code, 0)