summaryrefslogtreecommitdiffstats
path: root/test/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-08-22 17:57:28 -0500
committerLuke Kanies <luke@madstop.com>2007-08-22 17:57:28 -0500
commit8b3361afae35cfb65754d7bd9aff5b820ed714f0 (patch)
tree0a6fe8ce4029a8ea8bb82ab80dfb57cb5b6c20cc /test/network
parentf1727f18ab933df9ecbecc2da8fad72eb441e0d5 (diff)
downloadpuppet-8b3361afae35cfb65754d7bd9aff5b820ed714f0.tar.gz
puppet-8b3361afae35cfb65754d7bd9aff5b820ed714f0.tar.xz
puppet-8b3361afae35cfb65754d7bd9aff5b820ed714f0.zip
The last commits before I actually start on the multi-environment support. There are still failing tests, but apparently only those that are also failing in trunk.
Diffstat (limited to 'test/network')
-rwxr-xr-xtest/network/handler/node.rb68
-rwxr-xr-xtest/network/xmlrpc/processor.rb2
2 files changed, 2 insertions, 68 deletions
diff --git a/test/network/handler/node.rb b/test/network/handler/node.rb
index 745c7470e..d5c98fec6 100755
--- a/test/network/handler/node.rb
+++ b/test/network/handler/node.rb
@@ -12,7 +12,7 @@ require 'puppet/network/handler/node'
module NodeTesting
include PuppetTest
Node = Puppet::Network::Handler::Node
- SimpleNode = Puppet::Network::Handler::Node::SimpleNode
+ SimpleNode = Puppet::Node
def mk_node_mapper
# First, make sure our nodesearch command works as we expect
@@ -342,72 +342,6 @@ class TestNodeHandler < Test::Unit::TestCase
end
end
-class TestSimpleNode < Test::Unit::TestCase
- include NodeTesting
-
- # Make sure we get all the defaults correctly.
- def test_simplenode_initialize
- node = nil
- assert_nothing_raised("could not create a node without classes or parameters") do
- node = SimpleNode.new("testing")
- end
- assert_equal("testing", node.name, "Did not set name correctly")
- assert_equal({}, node.parameters, "Node parameters did not default correctly")
- assert_equal([], node.classes, "Node classes did not default correctly")
- assert_instance_of(Time, node.time, "Did not set the creation time")
-
- # Now test it with values for both
- params = {"a" => "b"}
- classes = %w{one two}
- assert_nothing_raised("could not create a node with classes and parameters") do
- node = SimpleNode.new("testing", :parameters => params, :classes => classes)
- end
- assert_equal("testing", node.name, "Did not set name correctly")
- assert_equal(params, node.parameters, "Node parameters did not get set correctly")
- assert_equal(classes, node.classes, "Node classes did not get set correctly")
-
- # And make sure a single class gets turned into an array
- assert_nothing_raised("could not create a node with a class as a string") do
- node = SimpleNode.new("testing", :classes => "test")
- end
- assert_equal(%w{test}, node.classes, "A node class string was not converted to an array")
-
- # Make sure we get environments
- assert_nothing_raised("could not create a node with an environment") do
- node = SimpleNode.new("testing", :environment => "test")
- end
- assert_equal("test", node.environment, "Environment was not set")
-
- # Now make sure we get the default env
- Puppet[:environment] = "prod"
- assert_nothing_raised("could not create a node with no environment") do
- node = SimpleNode.new("testing")
- end
- assert_equal("prod", node.environment, "Did not get default environment")
-
- # But that it stays nil if there's no default env set
- Puppet[:environment] = ""
- assert_nothing_raised("could not create a node with no environment and no default env") do
- node = SimpleNode.new("testing")
- end
- assert_nil(node.environment, "Got a default env when none was set")
-
- end
-
- # Verify that the node source wins over facter.
- def test_fact_merge
- node = SimpleNode.new("yay", :parameters => {"a" => "one", "b" => "two"})
-
- assert_nothing_raised("Could not merge parameters") do
- node.fact_merge("b" => "three", "c" => "yay")
- end
- params = node.parameters
- assert_equal("one", params["a"], "Lost nodesource parameters in parameter merge")
- assert_equal("two", params["b"], "Overrode nodesource parameters in parameter merge")
- assert_equal("yay", params["c"], "Did not get facts in parameter merge")
- end
-end
-
# Test our configuration object.
class TestNodeSources < Test::Unit::TestCase
include NodeTesting
diff --git a/test/network/xmlrpc/processor.rb b/test/network/xmlrpc/processor.rb
index 101d268b2..6808d0100 100755
--- a/test/network/xmlrpc/processor.rb
+++ b/test/network/xmlrpc/processor.rb
@@ -64,7 +64,7 @@ class TestXMLRPCProcessor < Test::Unit::TestCase
request.expects(:handler=).with("myhandler")
request.expects(:method=).with("mymethod")
- @processor.expects(:verify).times(2)
+ @processor.stubs(:verify)
@processor.expects(:handle).with(request.call,
"params", request.name, request.ip)