aboutsummaryrefslogtreecommitdiff
path: root/tests/managers/network/tool_run.py
blob: c05af9240d4627879905a9e73730c396f117e96e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
from datetime import datetime, timezone
from uuid import uuid4

import faker
import pytest

from generalresearch.models.network.definitions import IPProtocol

from generalresearch.models.network.tool_run import (
    ToolName,
    ToolClass,
    Status,
)

fake = faker.Faker()


def test_create_tool_run_from_nmap_run(nmap_run, toolrun_manager):

    toolrun_manager.create_nmap_run(nmap_run)

    run_out = toolrun_manager.get_nmap_run(nmap_run.id)

    assert nmap_run == run_out


def test_create_tool_run_from_rdns_run(rdns_run, toolrun_manager):

    toolrun_manager.create_rdns_run(rdns_run)

    run_out = toolrun_manager.get_rdns_run(rdns_run.id)

    assert rdns_run == run_out


def test_create_tool_run_from_mtr_run(mtr_run, toolrun_manager):

    toolrun_manager.create_mtr_run(mtr_run)

    run_out = toolrun_manager.get_mtr_run(mtr_run.id)

    assert mtr_run == run_out