def testMissingAttributes(self): """Test for instantiating a registry against outdated schema which misses butler_attributes table. """ # TODO: Once we have stable gen3 schema everywhere this test can be # dropped (DM-27373). config = self.makeRegistryConfig() config["db"] = "sqlite://" with self.assertRaises(MissingAttributesTableError): Registry.fromConfig(config)
def makeRegistry(self) -> Registry: config = RegistryConfig() config["db"] = f"sqlite://" return Registry.fromConfig(config, create=True)
def makeRegistry(self) -> Registry: namespace = f"namespace_{secrets.token_hex(8).lower()}" config = self.makeRegistryConfig() config["db"] = self.server.url() config["namespace"] = namespace return Registry.fromConfig(config, create=True)
def makeRegistry(self) -> Registry: _, filename = tempfile.mkstemp(dir=self.root, suffix=".sqlite3") config = RegistryConfig() config["db"] = f"sqlite:///{filename}" return Registry.fromConfig(config, create=True, butlerRoot=self.root)