forked from tyki6/rawsec_cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_filter.py
42 lines (38 loc) · 906 Bytes
/
test_filter.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
"""Test file for filter File"""
from rawsec_cli.filter import filter_projects
rawsec_projects = [
{
"name": "test",
"description": "a",
"language": "Python",
"price": "Paid",
"online": "True",
"blackarch": "test",
},
{
"name": "test2",
"description": "ab",
"language": "Go",
"price": "Free",
"online": "False",
"blackarch": "test",
},
]
def test_filter_projects():
"""test filter_projects function"""
projects = filter_projects(
rawsec_projects,
lang="Python",
paid=True,
online=True,
blackarch=True,
)
assert projects == [rawsec_projects[0]]
projects = filter_projects(
rawsec_projects,
lang="Go",
free=True,
offline=True,
blackarch=True,
)
assert projects == [rawsec_projects[1]]