debian-forge-composer/cmd/osbuild-worker-executor/handler_root_test.go
Michael Vogt a691df2353 osbuild-worker-executor: fix order of assert.Equal() in tests
The `assert.Equal()` expects that the "expected" value is put
first. Which is not what I'm used to. It's also slightly inconsistent
because `assert.EqualError()` expects the "actual" err first and
then the expected string. But this commit is not about ranting :)

This commit fixes the order in the tests assert.Equal() so that
mismatches actually are displayed correctly.
2024-06-07 08:17:32 +02:00

18 lines
371 B
Go

package main_test
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func TestTrivialRootEndpoint(t *testing.T) {
baseURL, _, loggerHook := runTestServer(t)
endpoint := baseURL
resp, err := http.Get(endpoint)
assert.NoError(t, err)
assert.Equal(t, 200, resp.StatusCode)
assert.Equal(t, "/ handler called", loggerHook.LastEntry().Message)
}