live_server = <LiveServer listening at http://localhost:6600>
event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
test_sample_folder = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_scanner_result_with_exclu0/sample-folder')
def test_scanner_result_with_exclude_patterns(
live_server, event_loop, test_sample_folder
):
api_url = live_server.url() + "/"
config = {"web-api": {"url": api_url, "auth-token": None}}
patterns = (str(test_sample_folder) + "/toexclude",)
exclude_pattern = {
reg_obj for reg_obj in extract_regex_objs(test_sample_folder, patterns)
}
source_tree = Tree(test_sample_folder)
event_loop.run_until_complete(
> run(config, test_sample_folder, source_tree, exclude_pattern)
)
.tox/py3/lib/python3.7/site-packages/swh/scanner/tests/test_scanner.py:112:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.7/asyncio/base_events.py:584: in run_until_complete
return future.result()
.tox/py3/lib/python3.7/site-packages/swh/scanner/scanner.py:194: in run
await _scan(root, session, api_url, source_tree, exclude_patterns)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
root = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_scanner_result_with_exclu0/sample-folder')
session = <aiohttp.client.ClientSession object at 0x7f1988672e48>
api_url = 'http://localhost:6600/'
source_tree = <swh.scanner.model.Tree object at 0x7f1988672390>
exclude_patterns = {re.compile('(?s:/tmp/pytest\\-of\\-jenkins/pytest\\-0/test_scanner_result_with_exclu0/sample\\-folder/toexclude)\\Z')}
async def _scan(root, session, api_url, source_tree, exclude_patterns):
for path, obj_swhid, known in await parse_path(
root, session, api_url, exclude_patterns
):
obj_type = parse_swhid(obj_swhid).object_type
if obj_type == CONTENT:
source_tree.add_node(path, obj_swhid, known)
elif obj_type == DIRECTORY and directory_filter(path, exclude_patterns):
> source_tree.add_node(path, obj_swhid, known)
E TypeError: add_node() takes 3 positional arguments but 4 were given
.tox/py3/lib/python3.7/site-packages/swh/scanner/scanner.py:184: TypeError
TEST RESULT
TEST RESULT
- Run At
- Dec 19 2020, 4:43 PM