Skip to content

Commit

Permalink
Merge pull request owasp-amass#240 from KJ202/develop
Browse files Browse the repository at this point in the history
Enhancement of Censys test
  • Loading branch information
caffix authored Aug 15, 2019
2 parents ebaed93 + fd3c38b commit 557ae93
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion services/sources/censys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/OWASP/Amass/resolvers"
)

func TestCensys(t *testing.T) {
func TestCensysAPIRequest(t *testing.T) {
if *networkTest == false || *configPath == "" {
return
}
Expand All @@ -32,3 +32,34 @@ func TestCensys(t *testing.T) {
t.Errorf("Found %d names, expected at least %d instead", result, expectedTest)
}
}

func TestCensysWebRequest(t *testing.T) {
if *networkTest == false {
return
}

cfg := setupConfig(domainTest)

api := cfg.GetAPIKey("censys")

if api != nil {
api.Key = ""
api.Secret = ""
cfg.AddAPIKey("censys",api)
}

bus, out := setupEventBus(requests.NewNameTopic)
defer bus.Stop()

pool := resolvers.NewResolverPool(nil)
defer pool.Stop()

srv := NewCensys(cfg, bus, pool)

result := testService(srv, out)
if result < expectedTest {
t.Errorf("Found %d names, expected at least %d instead", result, expectedTest)
}


}

0 comments on commit 557ae93

Please sign in to comment.