The test: ``` def test_directory_metadata_indexer_single_root_dir(self): metadata_indexer = DirectoryMetadataIndexer(config=DIRECTORY_METADATA_CONFIG) fill_obj_storage(metadata_indexer.objstorage) fill_storage(metadata_indexer.storage) ``` Error thrown in `collections.py`: ``` class ImmutableDict(...): ... def __getitem__(self, key): for (k, v) in self.data: if k == key: return v raise KeyError(key) ``` Call stack that led to this: ``` __getitem__ (/home/vmz/swh-environment/swh-model/swh/model/collections.py:40) __attrs_post_init__ (/home/vmz/swh-environment/swh-model/swh/model/model.py:873)----------------- 4 StorageData (/home/vmz/swh-environment/swh-storage/swh/storage/tests/storage_data.py:338)-------- 3 (/home/vmz/swh-environment/swh-storage/swh/storage/tests/storage_data.py:40)------------ 2 (/home/vmz/swh-environment/swh-storage/swh/storage/pytest_plugin.py:15) ---------------- 1 ``` 1: ``` from swh.storage.tests.storage_data import StorageData ``` 2: ``` class StorageData: ``` 3: ``` hg_revision = Revision( id=hash_to_bytes("951c9503541e7beaf002d7aebf2abd1629084c68"), message=b"hello", author=Person( name=b"Nicolas Dandrimont", email=b"nicolas@example.com", fullname=b"Nicolas Dandrimont ", ), date=TimestampWithTimezone( timestamp=Timestamp(seconds=1234567890, microseconds=0), offset_bytes=b"+0200", ), committer=Person( name=b"St\xc3fano Zacchiroli", email=b"stefano@example.com", fullname=b"St\xc3fano Zacchiroli ", ), committer_date=TimestampWithTimezone( timestamp=Timestamp(seconds=1123456789, microseconds=0), offset_bytes=b"+0200", ), parents=(), type=RevisionType.MERCURIAL, directory=directory.id, metadata={ "checksums": { "sha1": "tarball-sha1", "sha256": "tarball-sha256", }, "signed-off-by": "some-dude", "node": "a316dfb434af2b451c1f393496b7eaeda343f543", }, extra_headers=(), synthetic=True, ) ``` 4: ``` class Revision(HashableObjectWithManifest, BaseModel): def __attrs_post_init__(self): super().__attrs_post_init__() # ensure metadata is a deep copy of whatever was given, and if needed # extract extra_headers from there if self.metadata: metadata = self.metadata ** if not self.extra_headers and "extra_headers" in metadata: (extra_headers, metadata) = metadata.copy_pop("extra_headers") object.__setattr__( self, "extra_headers", tuplify_extra_headers(extra_headers), ) attr.validate(self) object.__setattr__(self, "metadata", metadata) ```