You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
1.7 KiB

  1. // Copyright 2019 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Code generated by gapic-generator. DO NOT EDIT.
  15. package datatransfer
  16. import (
  17. datatransferpb "google.golang.org/genproto/googleapis/cloud/bigquery/datatransfer/v1"
  18. )
  19. import (
  20. "context"
  21. "fmt"
  22. "strconv"
  23. "testing"
  24. "time"
  25. "cloud.google.com/go/internal/testutil"
  26. "google.golang.org/api/iterator"
  27. "google.golang.org/api/option"
  28. )
  29. var _ = fmt.Sprintf
  30. var _ = iterator.Done
  31. var _ = strconv.FormatUint
  32. var _ = time.Now
  33. func TestDataTransferServiceSmoke(t *testing.T) {
  34. if testing.Short() {
  35. t.Skip("skipping smoke test in short mode")
  36. }
  37. ctx := context.Background()
  38. ts := testutil.TokenSource(ctx, DefaultAuthScopes()...)
  39. if ts == nil {
  40. t.Skip("Integration tests skipped. See CONTRIBUTING.md for details")
  41. }
  42. projectId := testutil.ProjID()
  43. _ = projectId
  44. c, err := NewClient(ctx, option.WithTokenSource(ts))
  45. if err != nil {
  46. t.Fatal(err)
  47. }
  48. var formattedParent string = fmt.Sprintf("projects/%s", projectId)
  49. var request = &datatransferpb.ListDataSourcesRequest{
  50. Parent: formattedParent,
  51. }
  52. iter := c.ListDataSources(ctx, request)
  53. if _, err := iter.Next(); err != nil && err != iterator.Done {
  54. t.Error(err)
  55. }
  56. }