-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for dependency specifiers.
- vendor robdimsdale/sanitizer for integration test. [#135856239]
- Loading branch information
1 parent
6ee0f40
commit e9d5824
Showing
5 changed files
with
175 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package integration_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
pivnet "github.com/pivotal-cf/go-pivnet" | ||
) | ||
|
||
const ( | ||
dependentProductSlug = "stemcells" | ||
specifier = "3312.*" | ||
) | ||
|
||
var _ = Describe("Dependency 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: "pivotal_beta_eula", | ||
}) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
AfterEach(func() { | ||
err := client.Releases.Delete(testProductSlug, newRelease) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
It("creates, lists, and deletes dependency specifiers", func() { | ||
By("Listing dependency specifiers") | ||
dependencySpecifiers, err := client.DependencySpecifiers.List(testProductSlug, newRelease.ID) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
By("Creating new dependency specifier") | ||
dependencySpecifier, err := client.DependencySpecifiers.Create( | ||
testProductSlug, | ||
newRelease.ID, | ||
dependentProductSlug, | ||
specifier, | ||
) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
Expect(dependencySpecifiers).ShouldNot(ContainElement(dependencySpecifier)) | ||
|
||
By("Re-listing dependency specifiers") | ||
updatedDependencySpecifiers, err := client.DependencySpecifiers.List(testProductSlug, newRelease.ID) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
Expect(updatedDependencySpecifiers).Should(ContainElement(dependencySpecifier)) | ||
|
||
By("Getting individual dependency specifier") | ||
individualDependencySpecifier, err := client.DependencySpecifiers.Get( | ||
testProductSlug, | ||
newRelease.ID, | ||
dependencySpecifier.ID, | ||
) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
Expect(individualDependencySpecifier).To(Equal(dependencySpecifier)) | ||
|
||
By("Deleting dependency specifier") | ||
err = client.DependencySpecifiers.Delete( | ||
testProductSlug, | ||
newRelease.ID, | ||
dependencySpecifier.ID, | ||
) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
newlyUpdatedDependencySpecifiers, err := client.DependencySpecifiers.List(testProductSlug, newRelease.ID) | ||
Expect(err).NotTo(HaveOccurred()) | ||
|
||
Expect(newlyUpdatedDependencySpecifiers).ShouldNot(ContainElement(dependencySpecifier)) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters