mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 16:56:47 +00:00
- Added Copyright in handlers where missing - Renamed Project to Author(s) where needed Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
35 lines
804 B
Go
35 lines
804 B
Go
// Copyright (c) OpenFaaS Author(s). All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
)
|
|
|
|
func Test_Transform_DoesntTransformRootPath(t *testing.T) {
|
|
|
|
req, _ := http.NewRequest(http.MethodGet, "/", nil)
|
|
transformer := TransparentURLPathTransformer{}
|
|
want := req.URL.Path
|
|
got := transformer.Transform(req)
|
|
|
|
if want != got {
|
|
t.Errorf("want: %s, got: %s", want, got)
|
|
}
|
|
}
|
|
|
|
func Test_Transform_DoesntTransformAdditionalPath(t *testing.T) {
|
|
|
|
req, _ := http.NewRequest(http.MethodGet, "/employees/", nil)
|
|
transformer := TransparentURLPathTransformer{}
|
|
want := req.URL.Path
|
|
got := transformer.Transform(req)
|
|
|
|
if want != got {
|
|
t.Errorf("want: %s, got: %s", want, got)
|
|
}
|
|
|
|
}
|