Skip to content

Commit

Permalink
UT: Remove OTP feature flag test
Browse files Browse the repository at this point in the history
  • Loading branch information
mssalvatore committed Apr 7, 2023
1 parent 2b6bca9 commit 4aef716
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions monkey/tests/unit_tests/infection_monkey/test_monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
from tests.data_for_tests.otp import TEST_OTP

from common.common_consts import AGENT_OTP_ENVIRONMENT_VARIABLE
from infection_monkey.model import OTP_FLAG
from infection_monkey.monkey import InfectionMonkey


@pytest.fixture(autouse=True)
def configure_environment_variables(monkeypatch):
monkeypatch.setenv(AGENT_OTP_ENVIRONMENT_VARIABLE, TEST_OTP.get_secret_value())
monkeypatch.setenv(OTP_FLAG, True)


def test_get_otp(monkeypatch):
Expand All @@ -23,13 +21,3 @@ def test_get_otp__no_otp(monkeypatch):
monkeypatch.delenv(AGENT_OTP_ENVIRONMENT_VARIABLE)
with pytest.raises(Exception):
InfectionMonkey._get_otp()


def test_get_otp__feature_flag_disabled(monkeypatch):
try:
monkeypatch.delenv(OTP_FLAG)
except KeyError:
pass

# No need for a constant, this code is testing a feature flag that will be removed.
assert InfectionMonkey._get_otp().get_secret_value() == "PLACEHOLDER_OTP"

0 comments on commit 4aef716

Please sign in to comment.