Update the function utils.path.patch_volume which translates a path value according to a volume_map. The function previously selected the first volume_map item that matches the value to translated, which means the order of the volume_map is important for successful translation. This change selects the "best" volume_map item, where "best" is defined as the volume_map item most similar to the value to be translated with the smallest remainder.
Expand the patch_volume tests to add volume_map items with similar prefixes, and also test a reversed volume_map to ensure volume_map order is no longer important.
Update the function
utils.path.patch_volume
which translates a path value according to a volume_map. The function previously selected the first volume_map item that matches the value to translated, which means the order of the volume_map is important for successful translation. This change selects the "best" volume_map item, where "best" is defined as the volume_map item most similar to the value to be translated with the smallest remainder.Expand the
patch_volume
tests to add volume_map items with similar prefixes, and also test a reversed volume_map to ensure volume_map order is no longer important.