aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/api/responders_test/test_data/scheduled_scans.py
blob: 101957255263cad43de5e2c79247f165abebc934 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
###############################################################################
# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems)   #
# and others                                                                  #
#                                                                             #
# All rights reserved. This program and the accompanying materials            #
# are made available under the terms of the Apache License, Version 2.0       #
# which accompanies this distribution, and is available at                    #
# http://www.apache.org/licenses/LICENSE-2.0                                  #
###############################################################################
from test.api.responders_test.test_data import base

URL = "/scheduled_scans"
WRONG_FREQ = "wrong_freq"
CORRECT_FREQ = "WEEKLY"
WRONG_ID = base.WRONG_OBJECT_ID
NONEXISTENT_ID = "58c96a075eb66a121cc4e750"
CORRECT_ID = "ff4d3e80e42e886bef13a084"
NON_DICT_SCHEDULED_SCAN = ""


SCHEDULED_SCANS = [
    {
        "id": "ff4d3e80e42e886bef13a084",
        "environment": base.ENV_NAME,
        "scheduled_timestamp": "2017-07-24T12:45:03.784+0000",
        "freq": "WEEKLY"
    },
    {
        "id": "58e4e1aa6df71e971324ea62",
        "environment": base.ENV_NAME,
        "scheduled_timestamp": "2017-07-24T12:45:03.784+0000",
        "freq": "WEEKLY"
    }
]

SCHEDULED_SCANS_RESPONSE = {
    "scheduled_scans": SCHEDULED_SCANS
}

SCHEDULED_SCAN_WITH_SPECIFIC_FREQ = [{
    "id": "ff4d3e80e42e886bef13a084",
    "environment": base.ENV_NAME,
    "scheduled_timestamp": "2017-07-24T12:45:03.784+0000",
    "freq": CORRECT_FREQ
}]

SCHEDULED_SCAN_WITH_SPECIFIC_FREQ_RESPONSE = {
    "scheduled_scans": SCHEDULED_SCAN_WITH_SPECIFIC_FREQ
}

SCHEDULED_SCAN_WITH_SPECIFIC_ID = [{
    "id": CORRECT_ID,
    "environment": base.ENV_NAME,
    "scheduled_timestamp": "2017-07-24T12:45:03.784+0000",
    "freq": CORRECT_FREQ
}]

SCHEDULED_SCAN = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000"
}

SCHEDULED_SCAN_WITHOUT_ENV = {
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000"
}

SCHEDULED_SCAN_WITH_UNKNOWN_ENV = {
    "environment": base.UNKNOWN_ENV,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000"
}

SCHEDULED_SCAN_WITHOUT_FREQ = {
    "environment": base.ENV_NAME,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000"
}

SCHEDULED_SCAN_WITHOUT_SUBMIT_TIMESTAMP = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
}

SCHEDULED_SCAN_WITH_WRONG_FREQ = {
    "environment": base.ENV_NAME,
    "freq": WRONG_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000"
}

SCHEDULED_SCAN_WITH_WRONG_LOG_LEVEL = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "log_level": base.WRONG_LOG_LEVEL,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000"
}

SCHEDULED_SCAN_WITH_WRONG_SUBMIT_TIMESTAMP = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": base.WRONG_FORMAT_TIME
}

SCHEDULED_SCAN_WITH_NON_BOOL_CLEAR = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000",
    "clear": base.NON_BOOL
}

SCHEDULED_SCAN_WITH_NON_BOOL_SCAN_ONLY_LINKS = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000",
    "scan_only_links": base.NON_BOOL
}

SCHEDULED_SCAN_WITH_NON_BOOL_SCAN_ONLY_CLIQUES = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000",
    "scan_only_cliques": base.NON_BOOL
}

SCHEDULED_SCAN_WITH_NON_BOOL_SCAN_ONLY_INVENTORY = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000",
    "scan_only_inventory": base.NON_BOOL
}

SCHEDULED_SCAN_WITH_EXTRA_SCAN_ONLY_FLAGS = {
    "environment": base.ENV_NAME,
    "freq": CORRECT_FREQ,
    "submit_timestamp": "2017-07-24T12:45:03.784+0000",
    "scan_only_links": True,
    "scan_only_inventory": True
}