Sha256: 28893d1125c6f68fdceeefa2aab26d999d9d2368b5ebfedce8dffcc0fb029275

Contents?: true

Size: 1003 Bytes

Versions: 19

Compression:

Stored size: 1003 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../lib/puppettest'

require 'puppettest'

require 'puppet/network/client_request'

class TestClientRequest < Test::Unit::TestCase
  include PuppetTest

  def test_initialize
    req = nil
    assert_nothing_raised do
      req = Puppet::Network::ClientRequest.new("name", "ip", false)
    end

    assert_equal("name", req.name, "host name was not set correctly")
    assert_equal("ip", req.ip, "host ip was not set correctly")
    assert_equal(false, req.authenticated, "host auth was not set correctly")
    assert(! req.authenticated, "host was incorrectly considered authenticated")

    req.authenticated = true
    assert(req.authenticated, "host was not considered authenticated")

    assert_raise(ArgumentError) do
      req.call
    end

    req.handler = "yay"
    req.method = "foo"
    assert_equal("yay.foo", req.call, "call was not built correctly")

    assert_equal("name(ip)", req.to_s, "request string not correct")
  end
end


Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
puppet-2.6.18 test/network/client_request.rb
puppet-2.6.17 test/network/client_request.rb
puppet-2.6.16 test/network/client_request.rb
puppet-2.6.15 test/network/client_request.rb
puppet-2.6.14 test/network/client_request.rb
puppet-2.6.13 test/network/client_request.rb
puppet-2.6.12 test/network/client_request.rb
puppet-2.6.11 test/network/client_request.rb
puppet-2.6.10 test/network/client_request.rb
puppet-2.6.9 test/network/client_request.rb
puppet-2.6.8 test/network/client_request.rb
puppet-2.6.7 test/network/client_request.rb
puppet-2.6.6 test/network/client_request.rb
puppet-2.6.5 test/network/client_request.rb
puppet-2.6.4 test/network/client_request.rb
puppet-2.6.3 test/network/client_request.rb
puppet-2.6.2 test/network/client_request.rb
puppet-2.6.1 test/network/client_request.rb
puppet-2.6.0 test/network/client_request.rb