Skip to content

Commit

Permalink
home: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Jun 22, 2023
1 parent c7b60f3 commit 64eb519
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions internal/home/dns_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ func TestApplyAdditionalFiltering_blockedServices(t *testing.T) {
filtering.InitModule()

var (
globalBlockedServices = []string{"ok"}
clientBlockedServices = []string{"ok", "mail_ru", "vk"}
globalBlockedServices = []string{"ok"}
clientBlockedServices = []string{"ok", "mail_ru", "vk"}
nonValidBlockedServices = []string{"non_valid"}

err error
)
Expand All @@ -38,6 +39,10 @@ func TestApplyAdditionalFiltering_blockedServices(t *testing.T) {
BlockedServices: clientBlockedServices,
UseOwnBlockedServices: true,
},
"client_4": {
BlockedServices: nonValidBlockedServices,
UseOwnBlockedServices: true,
},
}

testCases := []struct {
Expand All @@ -58,6 +63,10 @@ func TestApplyAdditionalFiltering_blockedServices(t *testing.T) {
name: "custom_settings_block",
id: "client_3",
wantLen: len(clientBlockedServices),
}, {
name: "custom_settings_non_valid",
id: "client_4",
wantLen: 0,
}}

for _, tc := range testCases {
Expand Down

0 comments on commit 64eb519

Please sign in to comment.