/
files_test.rego
44 lines (40 loc) · 969 Bytes
/
files_test.rego
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
package files_test
import data.files.deny
test_deny_logo_if_added_in_wrong_directory {
expected := "Logo must be placed in docs/website/static/img/logos/integrations"
deny[expected] with input as [
{
"filename": "docs/website/data/integrations.yaml",
"status": "modified",
},
{
"filename": "docs/website/static/img/logos/example.png",
"status": "added",
},
]
}
test_allow_logo_if_added_in_correct_directory {
count(deny) == 0 with input as [
{
"filename": "docs/website/data/integrations.yaml",
"status": "modified",
},
{
"filename": "docs/website/static/img/logos/integrations/example.png",
"status": "added",
},
]
}
test_deny_logo_if_not_png_file {
expected := "Logo must be a .png file"
deny[expected] with input as [
{
"filename": "docs/website/data/integrations.yaml",
"status": "modified",
},
{
"filename": "docs/website/static/img/logos/integrations/example.jpg",
"status": "added",
},
]
}