This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding get-env to helpers for sane defaults (#12)
* Adding get-env to helpers for sane defaults * This makes it so you don't need to necessarily add the XPATH overrides We could also move those out of the sample env, but I chose to leave them * Adding a test for the get_env function in helpers_test.py * Fixing a few errant ] that I forgot to delete
- Loading branch information
1 parent
1e5f8cc
commit 19f37e2
Showing
4 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os, random, string | ||
from helpers import get_env | ||
|
||
def test_get_env(): | ||
random_string = ''.join(random.choice(string.lowercase) for i in range(15)) | ||
print "Random String: {}".format(random_string) | ||
os.environ["WINNAKER_TEST_ENV_VAR"] = "testingtesting" | ||
assert get_env("WINNAKER_TEST_ENV_VAR", "nottherightthing") == "testingtesting" | ||
assert get_env(random_string, "thedefault") == "thedefault" | ||
return True | ||
|
||
assert test_get_env() == True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters