Skip to content

Commit dc7592a

Browse files
committed
Minor test consistency improvement
1 parent 730ca44 commit dc7592a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_environment.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import os
4+
import re
45
import tempfile
56

67
import 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

0 commit comments

Comments
 (0)