Merge pull request #36 from R1kaB3rN/username

Update tests for usernames with digits
This commit is contained in:
Thomas Crider 2024-02-20 10:48:49 -07:00 committed by GitHub
commit 429de35ee3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -903,7 +903,7 @@ class TestGameLauncher(unittest.TestCase):
An error should not be raised when passing unexpanded paths to the config file as well as the prefix, proton and exe keys An error should not be raised when passing unexpanded paths to the config file as well as the prefix, proton and exe keys
""" """
test_toml = "foo.toml" test_toml = "foo.toml"
pattern = r"^/home/[a-zA-Z]+" pattern = r"^/home/[\w\d]+" # Expects only unicode decimals and alphanumerics
# Replaces the expanded path to unexpanded # Replaces the expanded path to unexpanded
# Example: ~/some/path/to/this/file -> /home/foo/path/to/this/file # Example: ~/some/path/to/this/file -> /home/foo/path/to/this/file
@ -1277,7 +1277,7 @@ class TestGameLauncher(unittest.TestCase):
After setting up the prefix then moving it to a different path, ensure that the symbolic link points to that new location After setting up the prefix then moving it to a different path, ensure that the symbolic link points to that new location
""" """
result = None result = None
pattern = r"^/home/[a-zA-Z]+" pattern = r"^/home/[\w\d]+" # Expects only unicode decimals and alphanumerics
unexpanded_path = re.sub( unexpanded_path = re.sub(
pattern, pattern,
"~", "~",
@ -1343,7 +1343,7 @@ class TestGameLauncher(unittest.TestCase):
pfx -> ~/.wine pfx -> ~/.wine
""" """
result = None result = None
pattern = r"^/home/[a-zA-Z]+" pattern = r"^/home/[\w\d]+" # Expects only unicode decimals and alphanumerics
unexpanded_path = re.sub( unexpanded_path = re.sub(
pattern, pattern,
"~", "~",
@ -1382,7 +1382,7 @@ class TestGameLauncher(unittest.TestCase):
An error should not be raised when passing paths such as ~/path/to/prefix. An error should not be raised when passing paths such as ~/path/to/prefix.
""" """
result = None result = None
pattern = r"^/home/[a-zA-Z]+" pattern = r"^/home/[\w\d]+" # Expects only unicode decimals and alphanumerics
unexpanded_path = re.sub( unexpanded_path = re.sub(
pattern, pattern,
"~", "~",
@ -1483,7 +1483,7 @@ class TestGameLauncher(unittest.TestCase):
def test_env_vars_paths(self): def test_env_vars_paths(self):
"""Test check_env when setting unexpanded paths for $WINEPREFIX and $PROTONPATH.""" """Test check_env when setting unexpanded paths for $WINEPREFIX and $PROTONPATH."""
pattern = r"^/home/[a-zA-Z]+" pattern = r"^/home/[\w\d]+" # Expects only unicode decimals and alphanumerics
path_to_tmp = Path( path_to_tmp = Path(
Path(__file__).cwd().as_posix() + "/" + self.test_file Path(__file__).cwd().as_posix() + "/" + self.test_file
).as_posix() ).as_posix()