Parent

Included Modules

Class/Module Index [+]

Quicksearch

RHEVMTest::HardwareProfilesTest

Public Instance Methods

app() click to toggle source
# File tests/drivers/rhevm/hardware_profiles_test.rb, line 9
def app
  Sinatra::Application
end
test_01_it_returns_hardware_profiles() click to toggle source
# File tests/drivers/rhevm/hardware_profiles_test.rb, line 13
def test_01_it_returns_hardware_profiles
  get_auth_url '/api;driver=rhevm/hardware_profiles'
  (last_xml_response/'hardware_profiles/hardware_profile').length.should == 2
end
test_02_each_hardware_profile_has_a_name() click to toggle source
# File tests/drivers/rhevm/hardware_profiles_test.rb, line 18
def test_02_each_hardware_profile_has_a_name
  get_auth_url '/api;driver=rhevm/hardware_profiles'
  (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
    (profile/'name').text.should_not == nil
    (profile/'name').text.should_not == ''
  end
end
test_03_each_hardware_profile_has_correct_properties() click to toggle source
# File tests/drivers/rhevm/hardware_profiles_test.rb, line 26
def test_03_each_hardware_profile_has_correct_properties
  get_auth_url '/api;driver=rhevm/hardware_profiles'
  (last_xml_response/'hardware_profiles/hardware_profile').each do |profile|
    (profile/'property[@name="architecture"]').first[:value].should == 'x86_64'
    (profile/'property[@name="memory"]').first[:unit].should == 'MB'
    (profile/'property[@name="memory"]').first[:kind].should == 'range'
    (profile/'property[@name="storage"]').first[:unit].should == 'GB'
    (profile/'property[@name="storage"]').first[:kind].should == 'range'
  end
end
test_04_it_returns_single_hardware_profile() click to toggle source
# File tests/drivers/rhevm/hardware_profiles_test.rb, line 37
def test_04_it_returns_single_hardware_profile
  get_auth_url '/api;driver=rhevm/hardware_profiles/DESKTOP'
  (last_xml_response/'hardware_profile/name').first.text.should == 'DESKTOP'
  (last_xml_response/'hardware_profile/property[@name="architecture"]').first[:value].should == 'x86_64'
  (last_xml_response/'hardware_profile/property[@name="memory"]').first[:value].should == '512'
  (last_xml_response/'hardware_profile/property[@name="storage"]').first[:value].should == '1'
end
test_05_it_filter_hardware_profiles() click to toggle source
# File tests/drivers/rhevm/hardware_profiles_test.rb, line 45
def test_05_it_filter_hardware_profiles
  get_auth_url '/api;driver=rhevm/hardware_profiles?architecture=i386'
  (last_xml_response/'hardware_profiles/hardware_profile').length.should == 0
  get_auth_url '/api;driver=rhevm/hardware_profiles?architecture=x86_64'
  (last_xml_response/'hardware_profiles/hardware_profile').length.should == 2
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.