Sha256: eeb8091db7e706e740530031aff71bfbdc21b5a4b64fb1784cbdd97d12b8010a

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

#!/usr/bin/ruby
#
# Copyright 2009, Google Inc. All Rights Reserved.
#
# 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
#
#     http://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.
#
# Tests the AdWords::AuthToken methods

require 'rubygems'
require 'test/unit'
require 'common_test_utils'
require 'adwords4r'

class TestAuthToken < Test::Unit::TestCase

  # Initialize tests
  def setup
    @adwords = CommonTestUtils.create_api_object(self)
  end

  # Test token generation
  def test_generation
    email = @adwords.credentials.credentials['email']
    password = @adwords.credentials.credentials['password']

    token = nil
    assert_nothing_raised do
      token = AdWords::AuthToken.get_token(email, password)
    end

    # Did we get back a non-empty string?
    assert((!token.nil? and !token.strip.empty?),
        'Null or empty token returned')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adwords4r-16.0.0 test/test_authtoken.rb