mirror of
https://github.com/containers/image.git
synced 2025-04-18 19:44:05 +03:00
This is useful primarily so that we can use build tags to remove transports from transports/alltransports, while giving users more hints about what to do instead of a bland “unknown transport”. Tests can also use this instead of their own mocks. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
19 lines
411 B
Go
19 lines
411 B
Go
package transports
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestStubTransport(t *testing.T) {
|
|
const name = "whatever"
|
|
|
|
s := NewStubTransport(name)
|
|
assert.Equal(t, name, s.Name())
|
|
_, err := s.ParseReference("this is rejected regardless of content")
|
|
assert.Error(t, err)
|
|
err = s.ValidatePolicyConfigurationScope("this is accepted regardless of content")
|
|
assert.NoError(t, err)
|
|
}
|