mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? Inlined the server and client code from the Nexus SDK ## Why? The protocol has been deemed to stay experimental for a while longer and we want to get trim Nexus Go SDK to the bare minimum. ## How did you test it? - [x] built - [x] run locally and tested manually - [x] covered by existing tests - [x] added new unit test(s)
20 lines
588 B
Go
20 lines
588 B
Go
package nexusrpc
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestNewHandleFailureConditions(t *testing.T) {
|
|
client, err := NewHTTPClient(HTTPClientOptions{BaseURL: "http://foo.com", Service: "test"})
|
|
require.NoError(t, err)
|
|
_, err = client.NewOperationHandle("", "token")
|
|
require.ErrorIs(t, err, errEmptyOperationName)
|
|
_, err = client.NewOperationHandle("name", "")
|
|
require.ErrorIs(t, err, errEmptyOperationToken)
|
|
_, err = client.NewOperationHandle("", "")
|
|
require.ErrorIs(t, err, errEmptyOperationName)
|
|
require.ErrorIs(t, err, errEmptyOperationToken)
|
|
}
|