"""The contract of :class:`~napalm_device_types.updates.UpdateMixin`.""" from __future__ import annotations import napalm_device_types from napalm_device_types.updates import PackageIndexMissing def test_a_missing_index_is_its_own_failure(): """A reader can tell "no index to read from" from any other failure, and a caller that only knows failures still catches it as one.""" exc = PackageIndexMissing("The package index is not loaded (run apk update first)") assert isinstance(exc, RuntimeError) assert str(exc) == "The package index is not loaded (run apk update first)" def test_it_is_exported_from_the_package(): assert napalm_device_types.PackageIndexMissing is PackageIndexMissing assert "PackageIndexMissing" in napalm_device_types.__all__