Fix test_directory_map

See #2475 and point 2 of #2334
Fix an argument in test_directory_helper