-
Notifications
You must be signed in to change notification settings - Fork 405
/
Copy pathutil_test.go
42 lines (34 loc) · 998 Bytes
/
util_test.go
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
package inputgraph
import (
"context"
"os"
"sync"
"testing"
"github.com/earthly/earthly/conslogging"
"github.com/earthly/earthly/domain"
"github.com/stretchr/testify/require"
)
func TestParseProjectCommand(t *testing.T) {
r := require.New(t)
target := domain.Target{
LocalPath: "./testdata/with-docker",
Target: "with-docker-load",
}
ctx := context.Background()
cons := conslogging.New(os.Stderr, &sync.Mutex{}, conslogging.NoColor, 0, conslogging.Info, false)
org, project, err := ParseProjectCommand(ctx, target, cons)
r.NoError(err)
r.Equal("earthly-technologies", org)
r.Equal("core", project)
}
func TestParseProjectCommandNoProject(t *testing.T) {
r := require.New(t)
target := domain.Target{
LocalPath: "./testdata/no-project",
Target: "no-project",
}
ctx := context.Background()
cons := conslogging.New(os.Stderr, &sync.Mutex{}, conslogging.NoColor, 0, conslogging.Info, false)
_, _, err := ParseProjectCommand(ctx, target, cons)
r.Error(err)
}