Skip to content

Commit

Permalink
[fix]: acceptance tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Hall <hallr@vmware.com>
  • Loading branch information
Rui Yang authored and Ryan Hall committed Jun 18, 2024
1 parent 422c682 commit 2a2b3e0
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions acceptance/download_product_pivnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@ package acceptance
import (
"archive/zip"
"bytes"
"cloud.google.com/go/storage"
"context"
"fmt"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
"github.com/onsi/gomega/ghttp"
"golang.org/x/oauth2/google"
"google.golang.org/api/option"
"io"
"io/ioutil"
"net/http"
Expand All @@ -21,6 +13,15 @@ import (
"path/filepath"
"strings"
"time"

"cloud.google.com/go/storage"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
"github.com/onsi/gomega/ghttp"
"golang.org/x/oauth2/google"
"google.golang.org/api/option"
)

var _ = Describe("download-product command", func() {
Expand Down Expand Up @@ -57,6 +58,9 @@ var _ = Describe("download-product command", func() {
server.RouteToHandler("GET", "/api/v2/products/pivnet-product/releases/24",
ghttp.RespondWith(http.StatusOK, `{"id":24}`),
)
server.RouteToHandler("POST", "/api/v2/products/pivnet-product/releases/24/pivnet_resource_eula_acceptance",
ghttp.RespondWith(http.StatusOK, nil),
)
server.RouteToHandler("GET", "/api/v2/products/pivnet-product/releases/24/product_files",
ghttp.RespondWith(http.StatusOK, fmt.Sprintf(`{
"product_files": [
Expand Down Expand Up @@ -127,6 +131,9 @@ var _ = Describe("download-product command", func() {
server.RouteToHandler("GET", "/api/v2/products/xenial-stemcells/releases/24",
ghttp.RespondWith(http.StatusOK, `{"id":24}`),
)
server.RouteToHandler("POST", "/api/v2/products/xenial-stemcells/releases/24/pivnet_resource_eula_acceptance",
ghttp.RespondWith(http.StatusOK, nil),
)
server.RouteToHandler("GET", "/api/v2/products/xenial-stemcells/releases/24/product_files",
ghttp.RespondWith(http.StatusOK, fmt.Sprintf(`{
"product_files": [
Expand Down

0 comments on commit 2a2b3e0

Please sign in to comment.