github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/pkg/coveragedb/mocks/ReadOnlyTransaction.go (about)

     1  // Code generated by mockery; DO NOT EDIT.
     2  // github.com/vektra/mockery
     3  // template: testify
     4  
     5  package mocks
     6  
     7  import (
     8  	"context"
     9  
    10  	"cloud.google.com/go/spanner"
    11  	"github.com/google/syzkaller/pkg/coveragedb/spannerclient"
    12  	mock "github.com/stretchr/testify/mock"
    13  )
    14  
    15  // NewReadOnlyTransaction creates a new instance of ReadOnlyTransaction. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    16  // The first argument is typically a *testing.T value.
    17  func NewReadOnlyTransaction(t interface {
    18  	mock.TestingT
    19  	Cleanup(func())
    20  }) *ReadOnlyTransaction {
    21  	mock := &ReadOnlyTransaction{}
    22  	mock.Mock.Test(t)
    23  
    24  	t.Cleanup(func() { mock.AssertExpectations(t) })
    25  
    26  	return mock
    27  }
    28  
    29  // ReadOnlyTransaction is an autogenerated mock type for the ReadOnlyTransaction type
    30  type ReadOnlyTransaction struct {
    31  	mock.Mock
    32  }
    33  
    34  type ReadOnlyTransaction_Expecter struct {
    35  	mock *mock.Mock
    36  }
    37  
    38  func (_m *ReadOnlyTransaction) EXPECT() *ReadOnlyTransaction_Expecter {
    39  	return &ReadOnlyTransaction_Expecter{mock: &_m.Mock}
    40  }
    41  
    42  // Query provides a mock function for the type ReadOnlyTransaction
    43  func (_mock *ReadOnlyTransaction) Query(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator {
    44  	ret := _mock.Called(ctx, statement)
    45  
    46  	if len(ret) == 0 {
    47  		panic("no return value specified for Query")
    48  	}
    49  
    50  	var r0 spannerclient.RowIterator
    51  	if returnFunc, ok := ret.Get(0).(func(context.Context, spanner.Statement) spannerclient.RowIterator); ok {
    52  		r0 = returnFunc(ctx, statement)
    53  	} else {
    54  		if ret.Get(0) != nil {
    55  			r0 = ret.Get(0).(spannerclient.RowIterator)
    56  		}
    57  	}
    58  	return r0
    59  }
    60  
    61  // ReadOnlyTransaction_Query_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Query'
    62  type ReadOnlyTransaction_Query_Call struct {
    63  	*mock.Call
    64  }
    65  
    66  // Query is a helper method to define mock.On call
    67  //   - ctx context.Context
    68  //   - statement spanner.Statement
    69  func (_e *ReadOnlyTransaction_Expecter) Query(ctx interface{}, statement interface{}) *ReadOnlyTransaction_Query_Call {
    70  	return &ReadOnlyTransaction_Query_Call{Call: _e.mock.On("Query", ctx, statement)}
    71  }
    72  
    73  func (_c *ReadOnlyTransaction_Query_Call) Run(run func(ctx context.Context, statement spanner.Statement)) *ReadOnlyTransaction_Query_Call {
    74  	_c.Call.Run(func(args mock.Arguments) {
    75  		var arg0 context.Context
    76  		if args[0] != nil {
    77  			arg0 = args[0].(context.Context)
    78  		}
    79  		var arg1 spanner.Statement
    80  		if args[1] != nil {
    81  			arg1 = args[1].(spanner.Statement)
    82  		}
    83  		run(
    84  			arg0,
    85  			arg1,
    86  		)
    87  	})
    88  	return _c
    89  }
    90  
    91  func (_c *ReadOnlyTransaction_Query_Call) Return(rowIterator spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call {
    92  	_c.Call.Return(rowIterator)
    93  	return _c
    94  }
    95  
    96  func (_c *ReadOnlyTransaction_Query_Call) RunAndReturn(run func(ctx context.Context, statement spanner.Statement) spannerclient.RowIterator) *ReadOnlyTransaction_Query_Call {
    97  	_c.Call.Return(run)
    98  	return _c
    99  }