Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed Jan 27, 2021
1 parent 3a77bc8 commit e15e5cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ and this project adheres to

### Changed

- Minor code improvement - added tests for safebrowsing and parental control services
- Stopped mounting together the directories `/opt/adguardhome/conf` and
`/opt/adguardhome/work` in our Docker images ([#2589]).
- When `dns.bogus_nxdomain` option is used, the server will now transform
Expand Down
6 changes: 3 additions & 3 deletions internal/dnsfilter/safebrowsing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ type testSbUpstream struct {
requestsCount int
}

// Exchange always returns a message with random hashes
// Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.requestsCount++

Expand Down Expand Up @@ -230,7 +230,7 @@ func TestSBPC_pcBlockedResponse(t *testing.T) {
res, err := d.checkParental("example.com")
assert.Nil(t, err)
assert.True(t, res.IsFiltered)
assert.Equal(t, 1, len(res.Rules))
assert.Len(t, res.Rules, 1)

// Check the cache state, check that the response is now cached
assert.Equal(t, 1, gctx.parentalCache.Stats().Count)
Expand All @@ -243,7 +243,7 @@ func TestSBPC_pcBlockedResponse(t *testing.T) {
res, err = d.checkParental("example.com")
assert.Nil(t, err)
assert.True(t, res.IsFiltered)
assert.Equal(t, 1, len(res.Rules))
assert.Len(t, res.Rules, 1)

// Check the cache state, it should've been used
assert.Equal(t, 1, gctx.parentalCache.Stats().Count)
Expand Down

0 comments on commit e15e5cf

Please sign in to comment.