self = <swh.storage.tests.algos.test_dir_iterator.TestDirectoryIterator testMethod=test_dir_iterator_no_empty_dirs>
mock_get_dir = <MagicMock name='_get_dir' id='139985472822912'>
def test_dir_iterator_no_empty_dirs(self, mock_get_dir):
dir_model = DirectoryModel()
dir_model.add_file(b"xyz/gtr/uhb")
dir_model.add_file(b"bca/ef")
dir_model.add_file(b"abc/ab")
dir_model.add_file(b"abc/bc")
dir_model.add_file(b"xyz/ouy/poi")
expected_paths_order = [
b"abc",
b"abc/ab",
b"abc/bc",
b"bca",
b"bca/ef",
b"xyz",
b"xyz/gtr",
b"xyz/gtr/uhb",
b"xyz/ouy",
b"xyz/ouy/poi",
]
> self.check_iterated_paths(dir_model, expected_paths_order, mock_get_dir)
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/algos/test_dir_iterator.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/algos/test_dir_iterator.py:105: in check_iterated_paths
paths_order = [e["path"] for e in dir_iterator(None, dir_model["target"])]
.tox/py3/lib/python3.7/site-packages/swh/storage/tests/algos/test_dir_iterator.py:33: in __getitem__
return hash_to_bytes(directory_identifier(self))
.tox/py3/lib/python3.7/site-packages/swh/model/identifiers.py:52: in directory_identifier
return hash_to_hex(model.Directory.from_dict(directory).id)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'swh.model.model.Directory'>
d = <swh.storage.tests.algos.test_dir_iterator.DirectoryModel object at 0x7f50e33beef0>
@classmethod
def from_dict(cls, d):
> d = d.copy()
E AttributeError: 'DirectoryModel' object has no attribute 'copy'
.tox/py3/lib/python3.7/site-packages/swh/model/model.py:706: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Sep 28 2021, 5:27 PM