Sha256: 5cb1b0029aa5e0b3018ac5345f58db61745f9e5b57c5c20858acec6517ef5965

Contents?: true

Size: 883 Bytes

Versions: 3

Compression:

Stored size: 883 Bytes

Contents

require '3scale/client'
require 'test/unit'

if ENV['TEST_3SCALE_PROVIDER_KEY'] && ENV['TEST_3SCALE_APP_IDS'] && ENV['TEST_3SCALE_APP_KEYS']
  class ThreeScale::PersistenceTest < Test::Unit::TestCase
    def setup
      provider_key = ENV['TEST_3SCALE_PROVIDER_KEY']

      @app_id = ENV['TEST_3SCALE_APP_IDS']
      @app_key = ENV['TEST_3SCALE_APP_KEYS']

      @client = ThreeScale::Client.new(:provider_key => provider_key, :persistence => true)

      if defined?(FakeWeb)
        FakeWeb.allow_net_connect = true
      end
    end

    def test_authorize
      assert @client.authorize(:app_id => @app_id, :app_key => @app_key).success?
    end

    def test_keepalive_disconnect
      assert @client.authorize(:app_id => @app_id, :app_key => @app_key).success?
      sleep 70
      assert @client.authorize(:app_id => @app_id, :app_key => @app_key).success?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
3scale_client-2.4.2 test/persistence_test.rb
3scale_client-2.4.0 test/persistence_test.rb
3scale_client-2.4.0.pre.1 test/persistence_test.rb