126 |
# user doesn't exist |
# user doesn't exist |
127 |
ok(! $node->set_user('foobar', 1), 'set_user'); |
ok(! $node->set_user('foobar', 1), 'set_user'); |
128 |
|
|
129 |
ok(my $node1 = new Search::Estraier::Node( "http://localhost:1978/node/$test2_node" ), "new $test2_node"); |
ok(my $node2 = new Search::Estraier::Node( "http://localhost:1978/node/$test2_node" ), "new $test2_node"); |
130 |
ok($node1->set_auth('admin','admin'), "set_auth $test2_node"); |
ok($node2->set_auth('admin','admin'), "set_auth $test2_node"); |
131 |
|
|
132 |
# croak_on_error |
# croak_on_error |
133 |
|
|
134 |
ok(my $node2 = new Search::Estraier::Node( url => "http://localhost:1978/non-existant", croak_on_error => 1 ), "new non-existant"); |
ok($node = new Search::Estraier::Node( url => "http://localhost:1978/non-existant", croak_on_error => 1 ), "new non-existant"); |
135 |
throws_ok { $node2->name } qr/404/, 'croak on error'; |
throws_ok { $node->name } qr/404/, 'croak on error'; |
136 |
|
|
137 |
|
# support for undef and 0 values |
138 |
|
#ok($node = new Search::Estraier::Node( url => "http://localhost:1978/$test1_node", croak_on_error => 1 ), "new $test1_node"); |
139 |
|
|
140 |
SKIP: { |
SKIP: { |
141 |
skip "no $test2_node in Hyper Estraier, skipping set_link", 2 unless (my $test1_label = $node1->label); |
skip "no $test2_node in Hyper Estraier, skipping set_link", 2 unless (my $test2_label = $node2->label); |
142 |
|
|
143 |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test1_label, 42), "set_link $test2_node ($test1_label) 42"); |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test2_label, 42), "set_link $test2_node ($test2_label) 42"); |
144 |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test1_label, 0), "set_link $test2_node ($test1_label) delete"); |
ok($node->set_link("http://localhost:1978/node/$test2_node", $test2_label, 0), "set_link $test2_node ($test2_label) delete"); |
145 |
} # SKIP 2 |
} # SKIP 2 |
146 |
|
|
147 |
} # SKIP 1 |
} # SKIP 1 |