Sha256: 28e7fbca6ac08c04e608f49a8ba73720f88f87c1a790f28172d29d66d37c6b7a

Contents?: true

Size: 1021 Bytes

Versions: 35

Compression:

Stored size: 1021 Bytes

Contents

#!/usr/bin/env ruby

require File.expand_path(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

35 entries across 35 versions & 3 rubygems

Version Path
puppet-2.7.26 test/network/client_request.rb
puppet-2.7.25 test/network/client_request.rb
puppet-2.7.24 test/network/client_request.rb
puppet-2.7.23 test/network/client_request.rb
puppet-2.7.22 test/network/client_request.rb
puppet-2.7.21 test/network/client_request.rb
puppet-2.7.20 test/network/client_request.rb
puppet-2.7.20.rc1 test/network/client_request.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/test/network/client_request.rb
puppet-2.7.19 test/network/client_request.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/test/network/client_request.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/test/network/client_request.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/test/network/client_request.rb
puppet-2.7.18 test/network/client_request.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/test/network/client_request.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/test/network/client_request.rb
puppet-2.7.17 test/network/client_request.rb
puppet-2.7.16 test/network/client_request.rb
puppet-2.7.14 test/network/client_request.rb
puppet-2.7.13 test/network/client_request.rb