Tests: Split up test_get_exploits_used_on_node()

This commit is contained in:
Mike Salvatore 2021-07-28 12:17:47 -04:00
parent 8583303682
commit 79639610df
1 changed files with 5 additions and 1 deletions

View File

@ -9,12 +9,16 @@ from monkey_island.cc.services.reporting.exploitations.monkey_exploitation impor
) )
def test_get_exploits_used_on_node(): def test_get_exploits_used_on_node__2_exploits():
exploits = get_exploits_used_on_node(NODE_DICT) exploits = get_exploits_used_on_node(NODE_DICT)
assert sorted(exploits) == sorted(["Elastic Groovy Exploiter", "Drupal Server Exploiter"]) assert sorted(exploits) == sorted(["Elastic Groovy Exploiter", "Drupal Server Exploiter"])
def test_get_exploits_used_on_node__duplicate_exploits():
exploits = get_exploits_used_on_node(NODE_DICT_DUPLICATE_EXPLOITS) exploits = get_exploits_used_on_node(NODE_DICT_DUPLICATE_EXPLOITS)
assert exploits == ["Drupal Server Exploiter"] assert exploits == ["Drupal Server Exploiter"]
def test_get_exploits_used_on_node__failed():
exploits = get_exploits_used_on_node(NODE_DICT_FAILED_EXPLOITS) exploits = get_exploits_used_on_node(NODE_DICT_FAILED_EXPLOITS)
assert exploits == [] assert exploits == []