Files
OpenShell/sdk/go/openshell/v1/client_test.go
John T. Myers f4dc6be4b2 refactor(inference): remove managed inference routes (#3195)
* refactor(inference): remove managed inference routes

Closes #3172

Remove the inference route control plane, inference.local data path, built-in router crate, and SDK surface. Move inference workloads to explicitly imported provider profiles and native endpoints, with migration cleanup and updated tests and documentation.

Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>

* fix(policy): preserve alternate upstream isolation

Restore the provider policy activation guard so legacy OpenAI and Anthropic providers configured for alternate base URLs do not grant egress to the built-in public vendor endpoints.

Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>

---------

Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
2026-09-09 18:47:22 +00:00

68 lines
1.6 KiB
Go

// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package v1
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewClient_EmptyAddress(t *testing.T) {
_, err := NewClient(Config{Address: ""})
require.Error(t, err)
assert.Contains(t, err.Error(), "address")
}
func TestNewClient_ValidConfig(t *testing.T) {
client, err := NewClient(Config{
Address: "localhost:50051",
Auth: NoAuth(),
TLS: &TLSConfig{Insecure: true},
})
require.NoError(t, err)
require.NotNil(t, client)
assert.NotNil(t, client.Sandboxes())
assert.NotNil(t, client.Providers())
assert.NotNil(t, client.Exec())
assert.NotNil(t, client.Files())
assert.NotNil(t, client.Health())
assert.NotNil(t, client.Services())
assert.NotNil(t, client.SSH())
assert.NotNil(t, client.TCP())
assert.NotNil(t, client.Config())
assert.NotNil(t, client.Policy())
assert.NotNil(t, client.Workspaces())
err = client.Close()
assert.NoError(t, err)
}
func TestClient_CloseIdempotent(t *testing.T) {
client, err := NewClient(Config{
Address: "localhost:50051",
Auth: NoAuth(),
TLS: &TLSConfig{Insecure: true},
})
require.NoError(t, err)
err = client.Close()
assert.NoError(t, err)
err = client.Close()
assert.NoError(t, err)
}
func TestNewClient_DefaultAuth(t *testing.T) {
client, err := NewClient(Config{
Address: "localhost:50051",
TLS: &TLSConfig{Insecure: true},
})
require.NoError(t, err)
require.NotNil(t, client)
_ = client.Close()
}