Revision abd8f1d1
Added by Daniel Lobato Garcia over 9 years ago
test/lib/proxy_api/bmc_test.rb | ||
---|---|---|
require "mocha/setup"
|
||
|
||
class ProxyApiBmcTest < ActiveSupport::TestCase
|
||
|
||
# Called before every test method runs. Can be used
|
||
# to set up fixture information.
|
||
def setup
|
||
... | ... | |
@testbmc.stubs(:put).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:put).with(data, expected_path).at_least_once
|
||
@testbmc.boot_cdrom(@options)
|
||
|
||
end
|
||
|
||
test "boot function should create correct url for bootdevice bios" do
|
||
... | ... | |
@testbmc.stubs(:put).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:put).with(data, expected_path).at_least_once
|
||
@testbmc.power_off(@options)
|
||
|
||
end
|
||
|
||
test "power function should create correct url for on" do
|
||
... | ... | |
@testbmc.stubs(:put).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:put).with(data, expected_path).at_least_once
|
||
@testbmc.power_cycle(@options)
|
||
|
||
end
|
||
|
||
test "power function should create correct url for soft" do
|
||
... | ... | |
@testbmc.stubs(:put).returns(fake_response({"result" => true}))
|
||
@testbmc.expects(:put).with(data, expected_path).at_least_once
|
||
@testbmc.power_soft(@options)
|
||
|
||
end
|
||
|
||
test "power function should create correct url for off?" do
|
||
... | ... | |
@testbmc.stubs(:get).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:get).with(expected_path, data).at_least_once
|
||
@testbmc.power_off?(@options)
|
||
|
||
end
|
||
test "power function should create correct url for on?" do
|
||
action = "on"
|
||
... | ... | |
@testbmc.stubs(:get).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:get).with(expected_path, data).at_least_once
|
||
@testbmc.power_on?(@options)
|
||
|
||
end
|
||
|
||
test "power function should create correct url for status" do
|
||
... | ... | |
@testbmc.stubs(:get).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:get).with(expected_path, data).at_least_once
|
||
@testbmc.power_status(@options)
|
||
|
||
end
|
||
|
||
test "identify function should create correct url for off" do
|
||
... | ... | |
@testbmc.stubs(:put).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:put).with(data, expected_path).at_least_once
|
||
@testbmc.identify_off(@options)
|
||
|
||
end
|
||
test "identify function should create correct url for on" do
|
||
action = "on"
|
||
... | ... | |
@testbmc.stubs(:put).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:put).with(data, expected_path).at_least_once
|
||
@testbmc.identify_on(@options)
|
||
|
||
end
|
||
|
||
test "identify function should create correct url for status" do
|
||
... | ... | |
@testbmc.stubs(:get).returns(fake_response(["fakedata"]))
|
||
@testbmc.expects(:get).with(expected_path, data).at_least_once
|
||
@testbmc.identify_status(@options)
|
||
|
||
end
|
||
|
||
test "lan function should create correct url for ip" do
|
||
... | ... | |
@testbmc.expects(:get).with(expected_path, data).at_least_once
|
||
@testbmc.lan_mac(@options)
|
||
end
|
||
|
||
|
||
|
||
|
||
end
|
Also available in: Unified diff
Refs #3809 - Remove cops for empty lines