-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Google Ads output to tests (#153)
* Add Google Ads binary input * Add Google Ads to default generator tests * Add Google Ads ServicePresenter test * Fix ServicePresenter test names
- Loading branch information
Showing
51 changed files
with
4,875 additions
and
3 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
166 changes: 166 additions & 0 deletions
166
gapic-generator/test/google/gapic/presenters/service/googleads_test.rb
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,166 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright 2019 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
require "test_helper" | ||
|
||
class GoogleAdsServiceTest < PresenterTest | ||
def presenter | ||
service_presenter :googleads, "CampaignService" | ||
end | ||
|
||
def test_name | ||
assert_equal "CampaignService", presenter.name | ||
end | ||
|
||
def test_methods | ||
refute_empty presenter.methods | ||
presenter.methods.each { |ref| assert_kind_of MethodPresenter, ref } | ||
exp_method_names = ["get_campaign", "mutate_campaigns"] | ||
assert_equal exp_method_names, presenter.methods.map(&:name) | ||
end | ||
|
||
def test_references | ||
assert_empty presenter.references | ||
end | ||
|
||
def test_proto_service_name_full | ||
assert_equal "Google::Ads::GoogleAds::V1::Services::CampaignService", presenter.proto_service_name_full | ||
end | ||
|
||
def test_proto_service_file_path | ||
assert_equal "google/ads/googleads/v1/services/campaign_service_pb.rb", presenter.proto_service_file_path | ||
end | ||
|
||
def test_proto_service_file_name | ||
assert_equal "campaign_service_pb.rb", presenter.proto_service_file_name | ||
end | ||
|
||
def test_proto_service_require | ||
assert_equal "google/ads/googleads/v1/services/campaign_service_pb", presenter.proto_service_require | ||
end | ||
|
||
def test_proto_services_file_path | ||
assert_equal "google/ads/googleads/v1/services/campaign_service_services_pb.rb", presenter.proto_services_file_path | ||
end | ||
|
||
def test_proto_services_file_name | ||
assert_equal "campaign_service_services_pb.rb", presenter.proto_services_file_name | ||
end | ||
|
||
def test_proto_services_require | ||
assert_equal "google/ads/googleads/v1/services/campaign_service_services_pb", presenter.proto_services_require | ||
end | ||
|
||
def test_proto_service_stub_name_full | ||
assert_equal "Google::Ads::GoogleAds::V1::Services::CampaignService::Stub", presenter.proto_service_stub_name_full | ||
end | ||
|
||
def test_credentials_name | ||
assert_equal "Credentials", presenter.credentials_name | ||
end | ||
|
||
def test_credentials_name_full | ||
assert_equal "Google::Ads::GoogleAds::V1::Services::CampaignService::Credentials", presenter.credentials_name_full | ||
end | ||
|
||
def test_credentials_file_path | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/credentials.rb", presenter.credentials_file_path | ||
end | ||
|
||
def test_credentials_file_name | ||
assert_equal "credentials.rb", presenter.credentials_file_name | ||
end | ||
|
||
def test_credentials_require | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/credentials", presenter.credentials_require | ||
end | ||
|
||
def test_operations_name | ||
assert_equal "Operations", presenter.operations_name | ||
end | ||
|
||
def test_operations_name_full | ||
assert_equal "Google::Ads::GoogleAds::V1::Services::CampaignService::Operations", presenter.operations_name_full | ||
end | ||
|
||
def test_operations_file_path | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/operations.rb", presenter.operations_file_path | ||
end | ||
|
||
def test_operations_file_name | ||
assert_equal "operations.rb", presenter.operations_file_name | ||
end | ||
|
||
def test_operations_require | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/operations", presenter.operations_require | ||
end | ||
|
||
def test_helpers_file_path | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/helpers.rb", presenter.helpers_file_path | ||
end | ||
|
||
def test_helpers_file_name | ||
assert_equal "helpers.rb", presenter.helpers_file_name | ||
end | ||
|
||
def test_helpers_require | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/helpers", presenter.helpers_require | ||
end | ||
|
||
def test_test_client_file_path | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service_test.rb", presenter.test_client_file_path | ||
end | ||
|
||
def test_stub_name | ||
assert_equal "campaign_service_stub", presenter.stub_name | ||
end | ||
|
||
def test_lro? | ||
refute presenter.lro? | ||
end | ||
|
||
def test_lro_client_var | ||
assert_equal "operations_client", presenter.lro_client_var | ||
end | ||
|
||
def test_lro_client_ivar | ||
assert_equal "@operations_client", presenter.lro_client_ivar | ||
end | ||
|
||
def test_paths? | ||
refute presenter.paths? | ||
end | ||
|
||
def test_paths_name | ||
assert_equal "Paths", presenter.paths_name | ||
end | ||
|
||
def test_paths_name_full | ||
assert_equal "Google::Ads::GoogleAds::V1::Services::CampaignService::Paths", presenter.paths_name_full | ||
end | ||
|
||
def test_paths_file_path | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/paths.rb", presenter.paths_file_path | ||
end | ||
|
||
def test_paths_file_name | ||
assert_equal "paths.rb", presenter.paths_file_name | ||
end | ||
|
||
def test_paths_require | ||
assert_equal "google/ads/google_ads/v1/services/campaign_service/paths", presenter.paths_require | ||
end | ||
end |
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
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
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
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
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,7 @@ | ||
:gem: | ||
:name: "google-ads-googleads" | ||
:defaults: | ||
:service: | ||
:default_host: "ads.googleapis.com" | ||
:oauth_scopes: | ||
- https://www.googleapis.com/auth/adwords |
Binary file not shown.
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,7 @@ | ||
inherit_gem: | ||
google-style: google-style.yml | ||
|
||
AllCops: | ||
Exclude: | ||
- "google-ads-googleads.gemspec" | ||
- "test/**/*" |
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,10 @@ | ||
--no-private | ||
--title=Google Ads Googleads | ||
--exclude _pb\.rb$ | ||
--markup markdown | ||
--markup-provider redcarpet | ||
|
||
./lib/**/*.rb | ||
./proto_docs/**/*.rb | ||
- | ||
README.md |
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,6 @@ | ||
source "https://rubygems.org" | ||
|
||
gemspec | ||
|
||
gem "google-gax", github: "googleapis/gax-ruby" | ||
gem "rake", "~> 11.0" |
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,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright <YEAR> <COPYRIGHT HOLDER> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,47 @@ | ||
# The MIT License (MIT) | ||
# | ||
# Copyright <YEAR> <COPYRIGHT HOLDER> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
|
||
|
||
require "bundler/setup" | ||
require "bundler/gem_tasks" | ||
|
||
require "rubocop/rake_task" | ||
RuboCop::RakeTask.new | ||
|
||
require "rake/testtask" | ||
desc "Run tests." | ||
Rake::TestTask.new do |t| | ||
t.test_files = FileList["test/**/*_test.rb"] | ||
t.warning = false | ||
end | ||
|
||
desc "Run smoke tests." | ||
Rake::TestTask.new :smoke_test do |t| | ||
t.test_files = FileList["acceptance/**/*smoke_test.rb"] | ||
t.warning = false | ||
end | ||
|
||
require "yard" | ||
require "yard/rake/yardoc_task" | ||
YARD::Rake::YardocTask.new | ||
|
||
task default: :test |
33 changes: 33 additions & 0 deletions
33
shared/output/gapic/templates/googleads/google-ads-googleads.gemspec
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,33 @@ | ||
# -*- ruby -*- | ||
# encoding: utf-8 | ||
|
||
require File.expand_path("lib/google/ads/googleads/version", __dir__) | ||
|
||
Gem::Specification.new do |gem| | ||
gem.name = "google-ads-googleads" | ||
gem.version = Google::Ads::Googleads::VERSION | ||
|
||
gem.authors = ["Google LLC"] | ||
gem.email = "googleapis-packages@google.com" | ||
gem.description = "google-ads-googleads is the official library for Google Ads Googleads API." | ||
gem.summary = "API Client library for Google Ads Googleads API" | ||
gem.homepage = "https://github.com/googleapis/googleapis" | ||
gem.license = "MIT" | ||
|
||
gem.platform = Gem::Platform::RUBY | ||
|
||
gem.files = `git ls-files -- lib/*`.split("\n") + | ||
`git ls-files -- proto_docs/*`.split("\n") + | ||
["README.md", "LICENSE", ".yardopts"] | ||
gem.require_paths = ["lib"] | ||
|
||
gem.required_ruby_version = ">= 2.0.0" | ||
|
||
gem.add_dependency "google-gax", "2.0.alpha.0.development" | ||
|
||
gem.add_development_dependency "google-style", "~> 0.3" | ||
gem.add_development_dependency "minitest", "~> 5.10" | ||
gem.add_development_dependency "redcarpet", "~> 3.0" | ||
gem.add_development_dependency "simplecov", "~> 0.9" | ||
gem.add_development_dependency "yard", "~> 0.9" | ||
end |
26 changes: 26 additions & 0 deletions
26
...utput/gapic/templates/googleads/lib/google/ads/google_ads/v1/services/campaign_service.rb
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,26 @@ | ||
# frozen_string_literal: true | ||
|
||
# The MIT License (MIT) | ||
# | ||
# Copyright <YEAR> <COPYRIGHT HOLDER> | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in | ||
# all copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
# THE SOFTWARE. | ||
|
||
require "google/ads/google_ads/v1/services/campaign_service/client" | ||
require "google/ads/google_ads/v1/services/campaign_service/credentials" |
Oops, something went wrong.