forked from nscuro/dtrack-client
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
project_test.go
50 lines (43 loc) · 1.09 KB
/
project_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
43
44
45
46
47
48
49
50
package dtrack
import (
"context"
"github.com/stretchr/testify/require"
"testing"
)
func TestProjectService_Clone(t *testing.T) {
client := setUpContainer(t, testContainerOptions{
APIPermissions: []string{
PermissionPortfolioManagement,
},
})
project, err := client.Project.Create(context.Background(), Project{
Name: "acme-app",
Version: "1.0.0",
})
require.NoError(t, err)
token, err := client.Project.Clone(context.Background(), ProjectCloneRequest{
ProjectUUID: project.UUID,
Version: "2.0.0",
})
require.NoError(t, err)
require.NotEmpty(t, token)
}
func TestProjectService_Clone_v4_10(t *testing.T) {
client := setUpContainer(t, testContainerOptions{
Version: "4.10.1",
APIPermissions: []string{
PermissionPortfolioManagement,
},
})
project, err := client.Project.Create(context.Background(), Project{
Name: "acme-app",
Version: "1.0.0",
})
require.NoError(t, err)
token, err := client.Project.Clone(context.Background(), ProjectCloneRequest{
ProjectUUID: project.UUID,
Version: "2.0.0",
})
require.NoError(t, err)
require.Empty(t, token)
}