tests: Modify technique reports' tests

This commit is contained in:
Shreya Malviya 2021-10-13 22:26:56 +05:30
parent f7f2e69152
commit b6923edbe9
1 changed files with 9 additions and 15 deletions

View File

@ -8,18 +8,6 @@ from monkey_island.cc.services.attack.technique_reports.__init__ import (
disabled_msg,
)
FAKE_CONFIG_SCHEMA_PER_ATTACK_TECHNIQUE = {
"T0000": {
"Definition Type 1": ["Config Option 1", "Config Option 2"],
"Definition Type 2": ["Config Option 5", "Config Option 6"],
"Property Type 1": ["Config Option 1 (Tab 1)"],
},
"T0001": {
"Definition Type 1": ["Config Option 1"],
"Definition Type 2": ["Config Option 5"],
},
}
@pytest.fixture(scope="function", autouse=True)
def mock_config_schema_per_attack_technique(monkeypatch, fake_schema):
@ -30,7 +18,7 @@ def mock_config_schema_per_attack_technique(monkeypatch, fake_schema):
class FakeAttackTechnique_TwoRelevantSystems(AttackTechnique):
tech_id = "T0001"
tech_id = "T0000"
relevant_systems = ["System 1", "System 2"]
unscanned_msg = "UNSCANNED"
scanned_msg = "SCANNED"
@ -44,8 +32,14 @@ class ExpectedMsgs_TwoRelevantSystems(Enum):
UNSCANNED: str = (
"UNSCANNED due to one of the following reasons:\n"
"- The following configuration options were disabled or empty:<br/>"
"- Definition Type 1 — Config Option 1<br/>"
"- Definition Type 2 — Config Option 5<br/>"
"- Definition Type 1 — Config Option 1, Config Option 2<br/>"
"- Definition Type 2 — Config Option 5, Config Option 6<br/>"
"- Property Type 1 -> Category 1 — Config Option 1<br/>"
"- Property Type 2 -> Category 1 — Config Option 1<br/>"
"- Property Type 2 -> Category 2 -> Config Option 1 — Config Option 1.1<br/>"
"- Property Type 2 -> Category 2 -> Config Option 2 — Config Option 2.1<br/>"
"- Property Type 2 -> Category 2 -> Config Option 2 -> Config Option 2.1 — Config Option "
"2.1.1<br/>"
)
SCANNED: str = "SCANNED"
USED: str = "USED"