Debian Codegraph @

internal/command/pull_test.go

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 package command
2
3 import (
4 "testing"
5
6 "github.com/isacikgoz/gitbatch/internal/git"
7 "github.com/stretchr/testify/require"
8 )
9
10 var (
11 testPullopts1 = &PullOptions{
12 RemoteName: "origin",
13 }
14
15 testPullopts2 = &PullOptions{
16 RemoteName: "origin",
17 Force: true,
18 }
19
20 testPullopts3 = &PullOptions{
21 RemoteName: "origin",
22 Progress: true,
23 }
24 )
25
26 func TestPullWithGit(t *testing.T) {
27 th := git.InitTestRepositoryFromLocal(t)
28 defer th.CleanUp(t)
29
30 var tests = []struct {
31 inp1 *git.Repository
32 inp2 *PullOptions
33 }{
34 {th.Repository, testPullopts1},
35 {th.Repository, testPullopts2},
36 }
37 for _, test := range tests {
38 err := pullWithGit(test.inp1, test.inp2)
39 require.NoError(t, err)
40 }
41 }
42
43 func TestPullWithGoGit(t *testing.T) {
44 th := git.InitTestRepositoryFromLocal(t)
45 defer th.CleanUp(t)
46
47 var tests = []struct {
48 inp1 *git.Repository
49 inp2 *PullOptions
50 }{
51 {th.Repository, testPullopts1},
52 {th.Repository, testPullopts3},
53 }
54 for _, test := range tests {
55 err := pullWithGoGit(test.inp1, test.inp2)
56 require.NoError(t, err)
57 }
58 }