22 """Base class for writing CLI butler command tests.
25 __all__ = (
"ButlerCmdTestBase",)
29 from lsst.daf.butler.cli
import butler
30 from lsst.daf.butler.cli.utils
import LogCliRunner
35 """Base class for tests of butler command line interface subcommands.
36 Subclass from this, then `unittest.TestCase` to get a working test suite.
42 """The fully qualified instrument class name.
47 The fully qualified instrument class name.
53 """Optional; if provided the register-instrument test will try to
54 register two instruments.
59 The fully qualified instrument class name.
64 """The instrument class."""
69 """The name of the instrument.
74 The name of the instrument.
79 runner = LogCliRunner()
80 with runner.isolated_filesystem():
81 result = runner.invoke(butler.cli, [
"create",
"here"])
82 self.assertEqual(result.exit_code, 0, f
"output: {result.output} exception: {result.exception}")
83 registerInstrumentArgs = [
"register-instrument",
"here", self.
instrumentClassNameinstrumentClassName]
86 result = runner.invoke(butler.cli, registerInstrumentArgs)
87 self.assertEqual(result.exit_code, 0, f
"output: {result.output} exception: {result.exception}")
88 result = runner.invoke(butler.cli, [
"write-curated-calibrations",
91 "--collection",
"collection"])
92 self.assertEqual(result.exit_code, 0, f
"output: {result.output} exception: {result.exception}")
def instrumentClassName(self)
def secondInstrumentClassName(self)