temp_folder = {'filesample': PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_scanner_get_subpaths0/subdir/filesample.txt'), 'filesam...9a060e54bf8d69288fbee4904', ...}, 'root': PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_scanner_get_subpaths0'), ...}
def test_scanner_get_subpaths(temp_folder):
root = temp_folder["root"]
actual_result = []
> for subpath, swhid in get_subpaths(root, tuple()):
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_scanner.py:70:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/scanner/scanner.py:125: in get_subpaths
yield (sub_path, swhid_of(sub_path))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_scanner_get_subpaths0/subfile.txt')
def swhid_of(path):
if path.is_dir():
if exclude_patterns:
def dir_filter(dirpath, *args):
return directory_filter(dirpath, exclude_patterns)
else:
dir_filter = accept_all_directories
obj = Directory.from_disk(
path=bytes(path), dir_filter=dir_filter
).get_data()
return CoreSWHID(object_type=ObjectType.DIRECTORY, object_id=obj["id"])
else:
obj = Content.from_file(path=bytes(path)).get_data()
> return Content(object_type=ObjectType.CONTENT, object_id=obj["sha1_git"])
E TypeError: __init__() got an unexpected keyword argument 'object_type'
.tox/py3/lib/python3.7/site-packages/swh/scanner/scanner.py:120: TypeError
TEST RESULT
TEST RESULT
- Run At
- Mar 1 2021, 4:52 PM