Revision 9d43fc71
Added by Michael Moll almost 6 years ago
test/models/compute_resource_test.rb | ||
---|---|---|
end
|
||
|
||
test "random_password should return nil when set_console_password is false" do
|
||
cr=compute_resources(:mycompute)
|
||
cr.set_console_password=0
|
||
cr = compute_resources(:mycompute)
|
||
cr.set_console_password = 0
|
||
assert_nil cr.send(:random_password) # Can't call protected methods directly
|
||
end
|
||
|
||
test "random_password should return a string when set_console_password is true" do
|
||
cr=compute_resources(:mycompute)
|
||
cr.set_console_password=1
|
||
cr = compute_resources(:mycompute)
|
||
cr.set_console_password = 1
|
||
assert_match /^[[:alnum:]]+$/, cr.send(:random_password) # Can't call protected methods directly
|
||
end
|
||
|
||
... | ... | |
end
|
||
|
||
test "libvirt vm_instance_defaults should contain the stored display type" do
|
||
cr=compute_resources(:mycompute)
|
||
cr.display_type='VNC'
|
||
cr = compute_resources(:mycompute)
|
||
cr.display_type = 'VNC'
|
||
assert_equal 'vnc', cr.send(:vm_instance_defaults)['display']['type']
|
||
cr.display_type='SPICE'
|
||
cr.display_type = 'SPICE'
|
||
assert_equal 'spice', cr.send(:vm_instance_defaults)['display']['type']
|
||
end
|
||
|
Also available in: Unified diff
Fixes #19789 - fix Layout/SpaceAroundOperators cop