mirror of https://github.com/daffainfo/nuclei.git
fixing tests
parent
4aff6d7189
commit
cbda987288
|
@ -31,6 +31,7 @@ func setup() {
|
|||
options := testutils.DefaultOptions
|
||||
testutils.Init(options)
|
||||
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
|
||||
parser, _ = templates.New()
|
||||
|
||||
executerOpts = protocols.ExecutorOptions{
|
||||
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
|
||||
|
|
|
@ -15,8 +15,10 @@ func TestCache(t *testing.T) {
|
|||
require.Nil(t, err, "invalid value for err")
|
||||
require.Nil(t, data, "invalid value for data")
|
||||
|
||||
templates.Store("test", &Template{}, testErr)
|
||||
item := &Template{}
|
||||
|
||||
templates.Store("test", item, testErr)
|
||||
data, err = templates.Has("test")
|
||||
require.Equal(t, testErr, err, "invalid value for err")
|
||||
require.Equal(t, "data", data, "invalid value for data")
|
||||
require.Equal(t, item, data, "invalid value for data")
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ func setup() {
|
|||
options := testutils.DefaultOptions
|
||||
testutils.Init(options)
|
||||
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
|
||||
parser, _ := templates.New()
|
||||
|
||||
executerOpts = protocols.ExecutorOptions{
|
||||
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
|
||||
|
@ -47,6 +48,7 @@ func setup() {
|
|||
Browser: nil,
|
||||
Catalog: disk.NewCatalog(config.DefaultConfig.TemplatesDirectory),
|
||||
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
|
||||
Parser: parser,
|
||||
}
|
||||
workflowLoader, err := parsers.NewLoader(&executerOpts)
|
||||
if err != nil {
|
||||
|
|
|
@ -25,6 +25,7 @@ func setup() {
|
|||
options := testutils.DefaultOptions
|
||||
testutils.Init(options)
|
||||
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
|
||||
parser, _ := templates.New()
|
||||
|
||||
executerOpts = protocols.ExecutorOptions{
|
||||
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
|
||||
|
@ -35,6 +36,7 @@ func setup() {
|
|||
Browser: nil,
|
||||
Catalog: disk.NewCatalog(config.DefaultConfig.TemplatesDirectory),
|
||||
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
|
||||
Parser: parser,
|
||||
}
|
||||
workflowLoader, err := parsers.NewLoader(&executerOpts)
|
||||
if err != nil {
|
||||
|
|
|
@ -25,6 +25,7 @@ func setup() {
|
|||
options := testutils.DefaultOptions
|
||||
testutils.Init(options)
|
||||
progressImpl, _ := progress.NewStatsTicker(0, false, false, false, 0)
|
||||
parser, _ := templates.New()
|
||||
|
||||
executerOpts = protocols.ExecutorOptions{
|
||||
Output: testutils.NewMockOutputWriter(options.OmitTemplate),
|
||||
|
@ -35,6 +36,7 @@ func setup() {
|
|||
Browser: nil,
|
||||
Catalog: disk.NewCatalog(config.DefaultConfig.TemplatesDirectory),
|
||||
RateLimiter: ratelimit.New(context.Background(), uint(options.RateLimit), time.Second),
|
||||
Parser: parser,
|
||||
}
|
||||
workflowLoader, err := parsers.NewLoader(&executerOpts)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue