File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import os
4+ import re
45import tempfile
56
67import pytest
@@ -15,11 +16,13 @@ def test_possibly_convert_to_windows_style_path():
1516 # Get an input path in the form "\path\to\tempdir"
1617 drive , tail = os .path .splitdrive (tmpdirname )
1718 input_path = tail .replace ('/' , '\\ ' )
19+ assert re .match (r"(\\[^/\\]+)+" , input_path )
1820 revised_path = possibly_convert_to_windows_style_path (input_path )
1921 assert input_path == revised_path
2022
21- # Get path in a form "/c/path/to/tempdir/test"
22- input_path = '/' + drive [0 ] + tail .replace ('\\ ' , '/' )
23+ # Get an input path in the form "/c/path/to/tempdir"
24+ input_path = '/' + drive [0 ].lower () + tail .replace ('\\ ' , '/' )
25+ assert re .match (r"/[a-z](/[^/\\]+)+" , input_path )
2326 expected = drive .upper () + tail .replace ('/' , '\\ ' )
2427 revised_path = possibly_convert_to_windows_style_path (input_path )
2528 assert expected == revised_path
You can’t perform that action at this time.
0 commit comments