Skip to content

Commit

Permalink
Mocking the command-line argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbovill committed Oct 26, 2023
1 parent 48d877a commit 9513947
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_obssys_state_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import sys
import unittest

import yaml
Expand Down Expand Up @@ -52,8 +53,12 @@ async def test_obssys_standby_disabled(self) -> None:
module.
"""
# Mock the command-line arguments that the obssys_standby_disabled.py
# script expects.
test_env = "tts"
sys.argv[1:] = [test_env]
# Instantiate the ObsSysStandbyDisabled integration tests.
script_class = ObsSysStandbyDisabled(test_env="tts")
script_class = ObsSysStandbyDisabled(test_env=test_env)
# Get number of scripts and the configuration.
num_scripts = len(script_class.scripts)
script_config = yaml.safe_load(script_class.configs[0])
Expand All @@ -73,8 +78,12 @@ async def test_obssys_disabled_enabled(self) -> None:
module.
"""
# Mock the command-line arguments that the obssys_disabled_enabled.py
# script expects.
test_env = "bts"
sys.argv[1:] = [test_env]
# Instantiate the ObsSysDisabledEnabled integration tests.
script_class = ObsSysDisabledEnabled(test_env="bts")
script_class = ObsSysDisabledEnabled(test_env=test_env)
# Get number of scripts and the configuration.
num_scripts = len(script_class.scripts)
script_config = yaml.safe_load(script_class.configs[0])
Expand Down

0 comments on commit 9513947

Please sign in to comment.