Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-41235: Update test to use SqlRegistry instead of Registry #380

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions tests/test_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
import math
import unittest

from lsst.daf.butler import DataCoordinate, DimensionPacker, DimensionUniverse, Registry, RegistryConfig
from lsst.daf.butler import DataCoordinate, DimensionPacker, DimensionUniverse, RegistryConfig
from lsst.daf.butler.formatters.json import JsonFormatter
from lsst.daf.butler.registry.sql_registry import SqlRegistry
from lsst.pex.config import Config
from lsst.pipe.base import Instrument
from lsst.utils.introspection import get_full_type_name
Expand Down Expand Up @@ -124,7 +125,7 @@ def test_register(self):
"""Test that register() sets appropriate Dimensions."""
registryConfig = RegistryConfig()
registryConfig["db"] = "sqlite://"
registry = Registry.createFromConfig(registryConfig)
registry = SqlRegistry.createFromConfig(registryConfig)
# Check that the registry starts out empty.
self.instrument.importAll(registry)
self.assertFalse(list(registry.queryDimensionRecords("instrument")))
Expand Down Expand Up @@ -205,7 +206,7 @@ def test_dimension_packer_config_defaults(self):
"""
registry_config = RegistryConfig()
registry_config["db"] = "sqlite://"
registry = Registry.createFromConfig(registry_config)
registry = SqlRegistry.createFromConfig(registry_config)
self.instrument.register(registry)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose all our Instrument APIs are going to have to switch to using a Butler in the future.

config = DimensionPackerTestConfig()
instrument_data_id = registry.expandDataId(instrument=self.name)
Expand Down Expand Up @@ -238,7 +239,7 @@ def test_dimension_packer_config_override(self):
"""
registry_config = RegistryConfig()
registry_config["db"] = "sqlite://"
registry = Registry.createFromConfig(registry_config)
registry = SqlRegistry.createFromConfig(registry_config)
# Intentionally do not register instrument or insert any other
# dimension records to ensure we don't need them in this mode.
config = DimensionPackerTestConfig()
Expand Down