forked from lacework-dev/container-auto-scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_auto_scan.py
56 lines (47 loc) · 1.99 KB
/
test_auto_scan.py
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
import argparse
import pytest
from auto_scan import get_container_registry_domains, main
from laceworksdk import LaceworkClient
lw_client = LaceworkClient()
def test_get_container_registry_domains():
response = get_container_registry_domains(lw_client)
assert(type(response) == list)
def test_main_default():
args = argparse.Namespace(account=None,
subaccount=None,
api_key=None,
api_secret=None,
inline_scanner=None,
inline_scanner_path=None,
inline_scanner_access_token=None,
inline_scanner_only=None,
profile=None,
proxy_scanner=None,
days=None,
hours=0,
registry=None,
rescan=None,
list_only=None,
daemon=None,
debug=None)
main(args)
def test_main_config_fail():
args = argparse.Namespace(account='testing',
subaccount=None,
api_key=None,
api_secret=None,
inline_scanner=None,
inline_scanner_path=None,
inline_scanner_access_token=None,
inline_scanner_only=None,
profile=None,
proxy_scanner=None,
days=None,
hours=0,
registry=None,
rescan=None,
list_only=None,
daemon=None,
debug=None)
with pytest.raises(Exception):
main(args)