github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/peer_connections.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	mock "github.com/stretchr/testify/mock"
     7  
     8  	peer "github.com/libp2p/go-libp2p/core/peer"
     9  )
    10  
    11  // PeerConnections is an autogenerated mock type for the PeerConnections type
    12  type PeerConnections struct {
    13  	mock.Mock
    14  }
    15  
    16  // IsConnected provides a mock function with given fields: peerID
    17  func (_m *PeerConnections) IsConnected(peerID peer.ID) (bool, error) {
    18  	ret := _m.Called(peerID)
    19  
    20  	var r0 bool
    21  	var r1 error
    22  	if rf, ok := ret.Get(0).(func(peer.ID) (bool, error)); ok {
    23  		return rf(peerID)
    24  	}
    25  	if rf, ok := ret.Get(0).(func(peer.ID) bool); ok {
    26  		r0 = rf(peerID)
    27  	} else {
    28  		r0 = ret.Get(0).(bool)
    29  	}
    30  
    31  	if rf, ok := ret.Get(1).(func(peer.ID) error); ok {
    32  		r1 = rf(peerID)
    33  	} else {
    34  		r1 = ret.Error(1)
    35  	}
    36  
    37  	return r0, r1
    38  }
    39  
    40  type mockConstructorTestingTNewPeerConnections interface {
    41  	mock.TestingT
    42  	Cleanup(func())
    43  }
    44  
    45  // NewPeerConnections creates a new instance of PeerConnections. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    46  func NewPeerConnections(t mockConstructorTestingTNewPeerConnections) *PeerConnections {
    47  	mock := &PeerConnections{}
    48  	mock.Mock.Test(t)
    49  
    50  	t.Cleanup(func() { mock.AssertExpectations(t) })
    51  
    52  	return mock
    53  }