Coverage for tests/cli_schema_doubles.py: 92%
13 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-14 09:21 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-14 09:21 +0000
1# This file is part of lsst-images.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# Use of this source code is governed by a 3-clause BSD-style
10# license that can be found in the LICENSE file.
11"""A development schema that exists only to exercise the fixtures CLI.
13``fixtures refresh`` acts only on schemas still in development, and every
14schema is finalized during a release, so a test that named a real one would
15stop exercising the path it claims. This double is never finalized.
17It is defined in the test tree, so ``available_schema_classes`` never returns
18it for ``lsst.images``: it is never frozen, published, or part of shipped
19data. Tests reach it by passing this module as the CLI's ``--package``, which
20selects this schema and no other.
22This is a plain module rather than a test module so importing it registers the
23schema deterministically, independent of pytest's collection order.
24"""
26from __future__ import annotations
28__all__ = ("CliFixtureDouble",)
30from typing import Any, ClassVar
32import pydantic
34from lsst.images.serialization import ArchiveTree, InputArchive
37class CliFixtureDouble(ArchiveTree):
38 """Development schema whose fixture the CLI tests write by hand."""
40 SCHEMA_NAME: ClassVar[str] = "cli_fixture_double"
41 SCHEMA_VERSION: ClassVar[str] = "1.0.0.dev0"
42 MIN_READ_VERSION: ClassVar[int] = 1
43 PUBLIC_TYPE: ClassVar[type] = dict
45 value: str = pydantic.Field(description="Arbitrary content; required, so an empty tree fails to read.")
47 def deserialize(self, archive: InputArchive[Any], **kwargs: Any) -> Any:
48 return {"value": self.value}