forked from CrowdStrike/falconpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_delivery_settings.py
More file actions
33 lines (28 loc) · 1.1 KB
/
Copy pathtest_delivery_settings.py
File metadata and controls
33 lines (28 loc) · 1.1 KB
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
# test_delivery settings.py
# This class tests the delivery settings service class
# import json
import os
import sys
# Authentication via the test_authorization.py
from tests import test_authorization as Authorization
# Import our sibling src folder into the path
sys.path.append(os.path.abspath('src'))
# Classes to test - manually imported from sibling folder
from falconpy import DeliverySettings
auth = Authorization.TestAuthorization()
config = auth.getConfigObject()
falcon = DeliverySettings(auth_object=config)
AllowedResponses = [200, 201, 207, 400, 429, 500]
class TestDeliverySettings:
def test_all_code_paths(self):
error_checks = True
tests = {
"GetDeliverySettings": falcon.get_delivery_settings(),
"PostDeliverySettings": falcon.create_delivery_settings(delivery_cadence="general_availability", delivery_type="sensor_operations")
}
for key in tests:
if tests[key]["status_code"] not in AllowedResponses:
error_checks = False
# print(key)
# print(tests[key])
assert error_checks