22 """Base class for writing CLI butler command tests.
25 __all__ = (
"ButlerCmdTestBase",)
31 from lsst.daf.butler.cli
import butler
36 """Base class for tests of butler command line interface subcommands.
37 Subclass from this, then `unittest.TestCase` to get a working test suite.
43 """The fully qualified instrument class name.
48 The fully qualified instrument class name.
54 """The instrument class."""
59 """The name of the instrument.
64 The name of the instrument.
69 runner = click.testing.CliRunner()
70 with runner.isolated_filesystem():
71 result = runner.invoke(butler.cli, [
"create",
"here"])
72 self.assertEqual(result.exit_code, 0, f
"output: {result.output} exception: {result.exception}")
73 result = runner.invoke(butler.cli, [
"register-instrument",
76 self.assertEqual(result.exit_code, 0, f
"output: {result.output} exception: {result.exception}")
77 result = runner.invoke(butler.cli, [
"write-curated-calibrations",
80 "--output-run",
"output_run"])
81 self.assertEqual(result.exit_code, 0, f
"output: {result.output} exception: {result.exception}")