summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/images_test.go
blob: e38b9390d288ab4e20781725b534f964262d1af1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package abi

import (
	"testing"

	"github.com/containers/common/libimage"
	"github.com/stretchr/testify/assert"
)

// This is really intended to verify what happens with a
// nil pointer in layer.Created, but we'll just sanity
// check round tripping 42.
func TestToDomainHistoryLayer(t *testing.T) {
	var layer libimage.ImageHistory
	layer.Size = 42
	newLayer := toDomainHistoryLayer(&layer)
	assert.Equal(t, layer.Size, newLayer.Size)
}

//
// import (
// 	"context"
// 	"testing"
//
// 	"github.com/stretchr/testify/mock"
// )
//
// type MockImageRuntime struct {
// 	mock.Mock
// }
//
// func (m *MockImageRuntime) Delete(ctx context.Context, renderer func() interface{}, name string) error {
// 	_ = m.Called(ctx, renderer, name)
// 	return nil
// }
//
// func TestImageSuccess(t *testing.T) {
// 	actual := func() interface{} { return nil }
//
// 	m := new(MockImageRuntime)
// 	m.On(
// 		"Delete",
// 		mock.AnythingOfType("*context.emptyCtx"),
// 		mock.AnythingOfType("func() interface {}"),
// 		"fedora").
// 		Return(nil)
//
// 	r := DirectImageRuntime{m}
// 	err := r.Delete(context.TODO(), actual, "fedora")
// 	if err != nil {
// 		t.Errorf("error should be nil, got: %v", err)
// 	}
// 	m.AssertExpectations(t)
// }