Remove redundant constructor, h/t sergio
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func TestNewStatsManager(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
if manager == nil {
|
||||
@@ -36,7 +36,7 @@ func TestNewStatsManager(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatsManagerSetStatsCallback(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
var callbackCalled bool
|
||||
@@ -85,7 +85,7 @@ func TestStatsManagerSetStatsCallback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatsManagerSetPeriod(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
newPeriod := 5 * time.Second
|
||||
@@ -97,7 +97,7 @@ func TestStatsManagerSetPeriod(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatsManagerStartStopStatsRoutine(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
if manager.running {
|
||||
@@ -125,7 +125,7 @@ func TestStatsManagerStartStopStatsRoutine(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatsManagerGetInterfaceStatsWithoutConnection(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
_, err := manager.GetInterfaceStats()
|
||||
@@ -206,7 +206,7 @@ func TestStatsCallback(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatsManagerQueryAndReportStatsWithoutConnection(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
// Should return false when not connected
|
||||
@@ -216,7 +216,7 @@ func TestStatsManagerQueryAndReportStatsWithoutConnection(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestStatsManagerWithShortPeriod(t *testing.T) {
|
||||
client := NewVPPClient()
|
||||
client := &VPPClient{}
|
||||
manager := NewStatsManager(client)
|
||||
|
||||
// Set a very short period for testing
|
||||
|
||||
Reference in New Issue
Block a user