Skip to content

Commit

Permalink
Corrected logic to set test webserver ENV variables
Browse files Browse the repository at this point in the history
Initially, was setting them in the if block if ENV variables already existed.
It wasn’t being set as if condition was being evaluated as False.
But if condition should be mainly to store existing values.
In any case, test values must be set, hence moving it outside if block.
  • Loading branch information
Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Apr 11, 2024
1 parent 02c7fc7 commit 4aeb4a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions emission/tests/netTests/TestWebserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def setUp(self):
if os.getenv(env_var_name) is not None:
# Storing original webserver environment variables before modification
self.originalWebserverEnvVars[env_var_name] = os.getenv(env_var_name)
# Setting webserver environment variables with test values
os.environ[env_var_name] = env_var_value
# Setting webserver environment variables with test values
os.environ[env_var_name] = env_var_value

logging.debug("Finished setting up test webserver environment variables")
logging.debug("Current original values are = %s" % self.originalWebserverEnvVars)
Expand Down

0 comments on commit 4aeb4a6

Please sign in to comment.