예제 #1
0
func TestGetRoutes(t *testing.T) {
	routes, err := proxymgr.GetRoutes()
	if err != nil {
		t.Errorf("Failed to GET routes - %v", err)
		t.FailNow()
	}

	if routes[0].Domain != testRoute.Domain {
		t.Errorf("Read route differs from written route")
	}
}
예제 #2
0
func TestDeleteRoute(t *testing.T) {
	if err := proxymgr.DeleteRoute(testRoute); err != nil {
		t.Errorf("Failed to DELETE route - %v", err)
	}

	routes, err := proxymgr.GetRoutes()
	if err != nil {
		t.Error(err)
	}

	if len(routes) != 0 {
		t.Errorf("Failed to DELETE route")
	}
}
예제 #3
0
func TestSetRoutes(t *testing.T) {
	if err := proxymgr.SetRoutes([]core.Route{testRoute}); err != nil {
		t.Errorf("Failed to SET routes - %v", err)
		t.FailNow()
	}

	routes, err := proxymgr.GetRoutes()
	if err != nil {
		t.Error(err)
	}

	if len(routes) == 1 && routes[0].Domain != testRoute.Domain {
		t.Errorf("Read route differs from written route")
	}
}