Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KingKDot committed Jan 21, 2024
1 parent b3e3ede commit 2134263
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,27 @@ def controller(self, file, hide_stuff):
return


def env_var_test():
GOOD_ENV_VARS = {
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC",
"PUBLIC": r"C:\Users\Public",
"COMMONPROGRAMFILES(X86)": r"C:\Program Files (x86)\Common Files",
"PROGRAMFILES": r"C:\Program Files",
"PROGRAMFILES(X86)": r"C:\Program Files (x86)",
"DRIVERDATA": r"C:\Windows\System32\Drivers\DriverData",
"COMMONPROGRAMFILES": r"C:\Program Files\Common Files",
"COMMONPROGRAMW6432": r"C:\Program Files\Common Files",
"COMMONPROGRAMFILES(X86)": r"C:\Program Files (x86)\Common Files",
}

users_env_vars = os.environ.copy()
for env_var, value in GOOD_ENV_VARS.items():
if users_env_vars[env_var] != value:
print(f"{env_var} is not set correctly")
return False
return True


def test_everything():
"""
A method that tests everything.
Expand All @@ -242,6 +263,19 @@ def test_everything():
assert new.full_test_sequence(True) == False


def test_env_vars():
"""
A method that tests the env vars.
Args:
- None
Returns:
- None
"""
assert env_var_test() == True


if __name__ == "__main__":
new = RunAll()
if new.full_test_sequence(False):
Expand Down

0 comments on commit 2134263

Please sign in to comment.