github.com/TeaOSLab/EdgeNode@v1.3.8/internal/nodes/http_cache_task_manager_test.go (about)

     1  // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
     2  
     3  package nodes_test
     4  
     5  import (
     6  	"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
     7  	"github.com/TeaOSLab/EdgeNode/internal/caches"
     8  	"github.com/TeaOSLab/EdgeNode/internal/nodes"
     9  	"testing"
    10  )
    11  
    12  func TestHTTPCacheTaskManager_Loop(t *testing.T) {
    13  	// initialize cache policies
    14  	config, err := nodeconfigs.SharedNodeConfig()
    15  	if err != nil {
    16  		t.Fatal(err)
    17  	}
    18  	caches.SharedManager.UpdatePolicies(config.HTTPCachePolicies)
    19  
    20  	var manager = nodes.NewHTTPCacheTaskManager()
    21  	err = manager.Loop()
    22  	if err != nil {
    23  		t.Fatal(err)
    24  	}
    25  }