def test_file_id_from_path_file_does_not_exit_short_path(find_id): file_id, parent_id = file_id_from_path( pathlib.Path('test/bad_path/file.txt')) find_id.assert_has_calls([call('test', 'root'), call('bad_path', 123)]) assert file_id is None assert parent_id is None
def test_file_id_from_path(find_id): file_id, parent_id = file_id_from_path(pathlib.Path('test/path/file.txt')) find_id.assert_has_calls( [call('test', 'root'), call('path', 123), call('file.txt', 345)]) assert file_id == 567 assert parent_id == 345
def test_file_id_from_path_file_does_not_exit(find_id): file_id, parent_id = file_id_from_path( pathlib.Path('test/path/other_file.txt')) find_id.assert_has_calls( [call('test', 'root'), call('path', 123), call('other_file.txt', 345)]) assert file_id is None assert parent_id == 345