File: stub_test.go

package info (click to toggle)
golang-github-containers-image 5.28.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,104 kB
  • sloc: sh: 194; makefile: 73
file content (18 lines) | stat: -rw-r--r-- 411 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)
}