-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathupgrade_path_specifiers_test.go
More file actions
79 lines (63 loc) · 2.21 KB
/
Copy pathupgrade_path_specifiers_test.go
File metadata and controls
79 lines (63 loc) · 2.21 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package integration_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
pivnet "github.com/pivotal-cf/go-pivnet/v9"
)
const (
upgradePathSpecifier = "~>1.2.3"
)
var _ = Describe("Upgrade Path Specifier Integration", func() {
var (
newRelease pivnet.Release
)
BeforeEach(func() {
var err error
newRelease, err = client.Releases.Create(pivnet.CreateReleaseConfig{
ProductSlug: testProductSlug,
Version: "some-test-version",
ReleaseType: "Beta Release",
EULASlug: "vmware-prerelease-eula",
})
Expect(err).NotTo(HaveOccurred())
})
AfterEach(func() {
err := client.Releases.Delete(testProductSlug, newRelease)
Expect(err).NotTo(HaveOccurred())
})
It("creates, lists, and deletes upgrade path specifiers", func() {
By("Listing upgrade path specifiers")
upgradePathSpecifiers, err := client.UpgradePathSpecifiers.List(testProductSlug, newRelease.ID)
Expect(err).NotTo(HaveOccurred())
By("Creating new dependency specifier")
upgradePathSpecifier, err := client.UpgradePathSpecifiers.Create(
testProductSlug,
newRelease.ID,
upgradePathSpecifier,
)
Expect(err).NotTo(HaveOccurred())
Expect(upgradePathSpecifiers).ShouldNot(ContainElement(upgradePathSpecifier))
By("Re-listing upgrade path specifiers")
updatedUpgradePathSpecifiers, err := client.UpgradePathSpecifiers.List(testProductSlug, newRelease.ID)
Expect(err).NotTo(HaveOccurred())
Expect(updatedUpgradePathSpecifiers).Should(ContainElement(upgradePathSpecifier))
By("Getting individual dependency specifier")
individualUpgradePathSpecifier, err := client.UpgradePathSpecifiers.Get(
testProductSlug,
newRelease.ID,
upgradePathSpecifier.ID,
)
Expect(err).NotTo(HaveOccurred())
Expect(individualUpgradePathSpecifier).To(Equal(upgradePathSpecifier))
By("Deleting upgrade path specifier")
err = client.UpgradePathSpecifiers.Delete(
testProductSlug,
newRelease.ID,
upgradePathSpecifier.ID,
)
Expect(err).NotTo(HaveOccurred())
newlyUpdatedUpgradePathSpecifiers, err := client.UpgradePathSpecifiers.List(testProductSlug, newRelease.ID)
Expect(err).NotTo(HaveOccurred())
Expect(newlyUpdatedUpgradePathSpecifiers).ShouldNot(ContainElement(upgradePathSpecifier))
})
})