mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-27 05:15:47 +00:00
test getting running config from router
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
|
"reflect"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -80,7 +81,7 @@ func TestNewRouter(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
_, moduleErrors, routeErrors := showbridge.NewRouter(routerConfig)
|
router, moduleErrors, routeErrors := showbridge.NewRouter(routerConfig)
|
||||||
|
|
||||||
if moduleErrors != nil {
|
if moduleErrors != nil {
|
||||||
t.Fatalf("router should not have returned any module errors: %v", moduleErrors)
|
t.Fatalf("router should not have returned any module errors: %v", moduleErrors)
|
||||||
@@ -89,6 +90,10 @@ func TestNewRouter(t *testing.T) {
|
|||||||
if routeErrors != nil {
|
if routeErrors != nil {
|
||||||
t.Fatalf("router should not have returned any route errors: %v", routeErrors)
|
t.Fatalf("router should not have returned any route errors: %v", routeErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !reflect.DeepEqual(routerConfig, router.RunningConfig()) {
|
||||||
|
t.Fatalf("router running config did not match expected, got: %v, expected: %v", router.RunningConfig(), routerConfig)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNewRouterNoModuleId(t *testing.T) {
|
func TestNewRouterNoModuleId(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user