v0.3.0 99dc266

pty_mock.go RawHistoryFolder

1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package portsmocks
6
7import (
8	"context"
9
10	"github.com/bnema/vev/internal/domain"
11	"github.com/bnema/vev/internal/ports"
12	mock "github.com/stretchr/testify/mock"
13)
14
15// NewMockPTY creates a new instance of MockPTY. 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.
17func NewMockPTY(t interface {
18	mock.TestingT
19	Cleanup(func())
20}) *MockPTY {
21	mock := &MockPTY{}
22	mock.Mock.Test(t)
23
24	t.Cleanup(func() { mock.AssertExpectations(t) })
25
26	return mock
27}
28
29// MockPTY is an autogenerated mock type for the PTY type
30type MockPTY struct {
31	mock.Mock
32}
33
34type MockPTY_Expecter struct {
35	mock *mock.Mock
36}
37
38func (_m *MockPTY) EXPECT() *MockPTY_Expecter {
39	return &MockPTY_Expecter{mock: &_m.Mock}
40}
41
42// Close provides a mock function for the type MockPTY
43func (_mock *MockPTY) Close() error {
44	ret := _mock.Called()
45
46	if len(ret) == 0 {
47		panic("no return value specified for Close")
48	}
49
50	var r0 error
51	if returnFunc, ok := ret.Get(0).(func() error); ok {
52		r0 = returnFunc()
53	} else {
54		r0 = ret.Error(0)
55	}
56	return r0
57}
58
59// MockPTY_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'
60type MockPTY_Close_Call struct {
61	*mock.Call
62}
63
64// Close is a helper method to define mock.On call
65func (_e *MockPTY_Expecter) Close() *MockPTY_Close_Call {
66	return &MockPTY_Close_Call{Call: _e.mock.On("Close")}
67}
68
69func (_c *MockPTY_Close_Call) Run(run func()) *MockPTY_Close_Call {
70	_c.Call.Run(func(args mock.Arguments) {
71		run()
72	})
73	return _c
74}
75
76func (_c *MockPTY_Close_Call) Return(err error) *MockPTY_Close_Call {
77	_c.Call.Return(err)
78	return _c
79}
80
81func (_c *MockPTY_Close_Call) RunAndReturn(run func() error) *MockPTY_Close_Call {
82	_c.Call.Return(run)
83	return _c
84}
85
86// ForegroundPgid provides a mock function for the type MockPTY
87func (_mock *MockPTY) ForegroundPgid() (int, error) {
88	ret := _mock.Called()
89
90	if len(ret) == 0 {
91		panic("no return value specified for ForegroundPgid")
92	}
93
94	var r0 int
95	var r1 error
96	if returnFunc, ok := ret.Get(0).(func() (int, error)); ok {
97		return returnFunc()
98	}
99	if returnFunc, ok := ret.Get(0).(func() int); ok {
100		r0 = returnFunc()
101	} else {
102		r0 = ret.Get(0).(int)
103	}
104	if returnFunc, ok := ret.Get(1).(func() error); ok {
105		r1 = returnFunc()
106	} else {
107		r1 = ret.Error(1)
108	}
109	return r0, r1
110}
111
112// MockPTY_ForegroundPgid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ForegroundPgid'
113type MockPTY_ForegroundPgid_Call struct {
114	*mock.Call
115}
116
117// ForegroundPgid is a helper method to define mock.On call
118func (_e *MockPTY_Expecter) ForegroundPgid() *MockPTY_ForegroundPgid_Call {
119	return &MockPTY_ForegroundPgid_Call{Call: _e.mock.On("ForegroundPgid")}
120}
121
122func (_c *MockPTY_ForegroundPgid_Call) Run(run func()) *MockPTY_ForegroundPgid_Call {
123	_c.Call.Run(func(args mock.Arguments) {
124		run()
125	})
126	return _c
127}
128
129func (_c *MockPTY_ForegroundPgid_Call) Return(n int, err error) *MockPTY_ForegroundPgid_Call {
130	_c.Call.Return(n, err)
131	return _c
132}
133
134func (_c *MockPTY_ForegroundPgid_Call) RunAndReturn(run func() (int, error)) *MockPTY_ForegroundPgid_Call {
135	_c.Call.Return(run)
136	return _c
137}
138
139// Pid provides a mock function for the type MockPTY
140func (_mock *MockPTY) Pid() int {
141	ret := _mock.Called()
142
143	if len(ret) == 0 {
144		panic("no return value specified for Pid")
145	}
146
147	var r0 int
148	if returnFunc, ok := ret.Get(0).(func() int); ok {
149		r0 = returnFunc()
150	} else {
151		r0 = ret.Get(0).(int)
152	}
153	return r0
154}
155
156// MockPTY_Pid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Pid'
157type MockPTY_Pid_Call struct {
158	*mock.Call
159}
160
161// Pid is a helper method to define mock.On call
162func (_e *MockPTY_Expecter) Pid() *MockPTY_Pid_Call {
163	return &MockPTY_Pid_Call{Call: _e.mock.On("Pid")}
164}
165
166func (_c *MockPTY_Pid_Call) Run(run func()) *MockPTY_Pid_Call {
167	_c.Call.Run(func(args mock.Arguments) {
168		run()
169	})
170	return _c
171}
172
173func (_c *MockPTY_Pid_Call) Return(n int) *MockPTY_Pid_Call {
174	_c.Call.Return(n)
175	return _c
176}
177
178func (_c *MockPTY_Pid_Call) RunAndReturn(run func() int) *MockPTY_Pid_Call {
179	_c.Call.Return(run)
180	return _c
181}
182
183// Read provides a mock function for the type MockPTY
184func (_mock *MockPTY) Read(p []byte) (int, error) {
185	ret := _mock.Called(p)
186
187	if len(ret) == 0 {
188		panic("no return value specified for Read")
189	}
190
191	var r0 int
192	var r1 error
193	if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok {
194		return returnFunc(p)
195	}
196	if returnFunc, ok := ret.Get(0).(func([]byte) int); ok {
197		r0 = returnFunc(p)
198	} else {
199		r0 = ret.Get(0).(int)
200	}
201	if returnFunc, ok := ret.Get(1).(func([]byte) error); ok {
202		r1 = returnFunc(p)
203	} else {
204		r1 = ret.Error(1)
205	}
206	return r0, r1
207}
208
209// MockPTY_Read_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Read'
210type MockPTY_Read_Call struct {
211	*mock.Call
212}
213
214// Read is a helper method to define mock.On call
215//   - p []byte
216func (_e *MockPTY_Expecter) Read(p any) *MockPTY_Read_Call {
217	return &MockPTY_Read_Call{Call: _e.mock.On("Read", p)}
218}
219
220func (_c *MockPTY_Read_Call) Run(run func(p []byte)) *MockPTY_Read_Call {
221	_c.Call.Run(func(args mock.Arguments) {
222		var arg0 []byte
223		if args[0] != nil {
224			arg0 = args[0].([]byte)
225		}
226		run(
227			arg0,
228		)
229	})
230	return _c
231}
232
233func (_c *MockPTY_Read_Call) Return(n int, err error) *MockPTY_Read_Call {
234	_c.Call.Return(n, err)
235	return _c
236}
237
238func (_c *MockPTY_Read_Call) RunAndReturn(run func(p []byte) (int, error)) *MockPTY_Read_Call {
239	_c.Call.Return(run)
240	return _c
241}
242
243// Resize provides a mock function for the type MockPTY
244func (_mock *MockPTY) Resize(sz domain.Size) error {
245	ret := _mock.Called(sz)
246
247	if len(ret) == 0 {
248		panic("no return value specified for Resize")
249	}
250
251	var r0 error
252	if returnFunc, ok := ret.Get(0).(func(domain.Size) error); ok {
253		r0 = returnFunc(sz)
254	} else {
255		r0 = ret.Error(0)
256	}
257	return r0
258}
259
260// MockPTY_Resize_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Resize'
261type MockPTY_Resize_Call struct {
262	*mock.Call
263}
264
265// Resize is a helper method to define mock.On call
266//   - sz domain.Size
267func (_e *MockPTY_Expecter) Resize(sz any) *MockPTY_Resize_Call {
268	return &MockPTY_Resize_Call{Call: _e.mock.On("Resize", sz)}
269}
270
271func (_c *MockPTY_Resize_Call) Run(run func(sz domain.Size)) *MockPTY_Resize_Call {
272	_c.Call.Run(func(args mock.Arguments) {
273		var arg0 domain.Size
274		if args[0] != nil {
275			arg0 = args[0].(domain.Size)
276		}
277		run(
278			arg0,
279		)
280	})
281	return _c
282}
283
284func (_c *MockPTY_Resize_Call) Return(err error) *MockPTY_Resize_Call {
285	_c.Call.Return(err)
286	return _c
287}
288
289func (_c *MockPTY_Resize_Call) RunAndReturn(run func(sz domain.Size) error) *MockPTY_Resize_Call {
290	_c.Call.Return(run)
291	return _c
292}
293
294// Write provides a mock function for the type MockPTY
295func (_mock *MockPTY) Write(p []byte) (int, error) {
296	ret := _mock.Called(p)
297
298	if len(ret) == 0 {
299		panic("no return value specified for Write")
300	}
301
302	var r0 int
303	var r1 error
304	if returnFunc, ok := ret.Get(0).(func([]byte) (int, error)); ok {
305		return returnFunc(p)
306	}
307	if returnFunc, ok := ret.Get(0).(func([]byte) int); ok {
308		r0 = returnFunc(p)
309	} else {
310		r0 = ret.Get(0).(int)
311	}
312	if returnFunc, ok := ret.Get(1).(func([]byte) error); ok {
313		r1 = returnFunc(p)
314	} else {
315		r1 = ret.Error(1)
316	}
317	return r0, r1
318}
319
320// MockPTY_Write_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Write'
321type MockPTY_Write_Call struct {
322	*mock.Call
323}
324
325// Write is a helper method to define mock.On call
326//   - p []byte
327func (_e *MockPTY_Expecter) Write(p any) *MockPTY_Write_Call {
328	return &MockPTY_Write_Call{Call: _e.mock.On("Write", p)}
329}
330
331func (_c *MockPTY_Write_Call) Run(run func(p []byte)) *MockPTY_Write_Call {
332	_c.Call.Run(func(args mock.Arguments) {
333		var arg0 []byte
334		if args[0] != nil {
335			arg0 = args[0].([]byte)
336		}
337		run(
338			arg0,
339		)
340	})
341	return _c
342}
343
344func (_c *MockPTY_Write_Call) Return(n int, err error) *MockPTY_Write_Call {
345	_c.Call.Return(n, err)
346	return _c
347}
348
349func (_c *MockPTY_Write_Call) RunAndReturn(run func(p []byte) (int, error)) *MockPTY_Write_Call {
350	_c.Call.Return(run)
351	return _c
352}
353
354// NewMockPTYFactory creates a new instance of MockPTYFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
355// The first argument is typically a *testing.T value.
356func NewMockPTYFactory(t interface {
357	mock.TestingT
358	Cleanup(func())
359}) *MockPTYFactory {
360	mock := &MockPTYFactory{}
361	mock.Mock.Test(t)
362
363	t.Cleanup(func() { mock.AssertExpectations(t) })
364
365	return mock
366}
367
368// MockPTYFactory is an autogenerated mock type for the PTYFactory type
369type MockPTYFactory struct {
370	mock.Mock
371}
372
373type MockPTYFactory_Expecter struct {
374	mock *mock.Mock
375}
376
377func (_m *MockPTYFactory) EXPECT() *MockPTYFactory_Expecter {
378	return &MockPTYFactory_Expecter{mock: &_m.Mock}
379}
380
381// Open provides a mock function for the type MockPTYFactory
382func (_mock *MockPTYFactory) Open(ctx context.Context, cmd string, args []string, env []string, dir string, sz domain.Size) (ports.PTY, error) {
383	ret := _mock.Called(ctx, cmd, args, env, dir, sz)
384
385	if len(ret) == 0 {
386		panic("no return value specified for Open")
387	}
388
389	var r0 ports.PTY
390	var r1 error
391	if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, []string, string, domain.Size) (ports.PTY, error)); ok {
392		return returnFunc(ctx, cmd, args, env, dir, sz)
393	}
394	if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, []string, string, domain.Size) ports.PTY); ok {
395		r0 = returnFunc(ctx, cmd, args, env, dir, sz)
396	} else {
397		if ret.Get(0) != nil {
398			r0 = ret.Get(0).(ports.PTY)
399		}
400	}
401	if returnFunc, ok := ret.Get(1).(func(context.Context, string, []string, []string, string, domain.Size) error); ok {
402		r1 = returnFunc(ctx, cmd, args, env, dir, sz)
403	} else {
404		r1 = ret.Error(1)
405	}
406	return r0, r1
407}
408
409// MockPTYFactory_Open_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Open'
410type MockPTYFactory_Open_Call struct {
411	*mock.Call
412}
413
414// Open is a helper method to define mock.On call
415//   - ctx context.Context
416//   - cmd string
417//   - args []string
418//   - env []string
419//   - dir string
420//   - sz domain.Size
421func (_e *MockPTYFactory_Expecter) Open(ctx any, cmd any, args any, env any, dir any, sz any) *MockPTYFactory_Open_Call {
422	return &MockPTYFactory_Open_Call{Call: _e.mock.On("Open", ctx, cmd, args, env, dir, sz)}
423}
424
425func (_c *MockPTYFactory_Open_Call) Run(run func(ctx context.Context, cmd string, args []string, env []string, dir string, sz domain.Size)) *MockPTYFactory_Open_Call {
426	_c.Call.Run(func(args mock.Arguments) {
427		var arg0 context.Context
428		if args[0] != nil {
429			arg0 = args[0].(context.Context)
430		}
431		var arg1 string
432		if args[1] != nil {
433			arg1 = args[1].(string)
434		}
435		var arg2 []string
436		if args[2] != nil {
437			arg2 = args[2].([]string)
438		}
439		var arg3 []string
440		if args[3] != nil {
441			arg3 = args[3].([]string)
442		}
443		var arg4 string
444		if args[4] != nil {
445			arg4 = args[4].(string)
446		}
447		var arg5 domain.Size
448		if args[5] != nil {
449			arg5 = args[5].(domain.Size)
450		}
451		run(
452			arg0,
453			arg1,
454			arg2,
455			arg3,
456			arg4,
457			arg5,
458		)
459	})
460	return _c
461}
462
463func (_c *MockPTYFactory_Open_Call) Return(pTY ports.PTY, err error) *MockPTYFactory_Open_Call {
464	_c.Call.Return(pTY, err)
465	return _c
466}
467
468func (_c *MockPTYFactory_Open_Call) RunAndReturn(run func(ctx context.Context, cmd string, args []string, env []string, dir string, sz domain.Size) (ports.PTY, error)) *MockPTYFactory_Open_Call {
469	_c.Call.Return(run)
470	return _c
471}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close