Split test_path parsing into its own function.