Add functional test for ag and vnet.

This commit is contained in:
Jeff Mendoza 2013-11-22 12:46:53 -08:00
Родитель 702a72c3a4
Коммит 98413471a4
3 изменённых файлов: 57 добавлений и 2 удалений

Просмотреть файл

@ -38,9 +38,9 @@ class Chef
cols = ['Name', 'Affinity Group', 'State']
the_list = cols.map { |col| ui.color(col, :bold) }
connection.vnets.all.each do |ag|
connection.vnets.all.each do |vnet|
%w(name affinity_group state).each do |attr|
the_list << ag.send(attr).to_s
the_list << vnet.send(attr).to_s
end
end

Просмотреть файл

@ -0,0 +1,25 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe 'ags' do
before(:all) do
@connection = Azure::Connection.new(TEST_PARAMS)
end
it 'create' do
rsp = @connection.ags.create(azure_ag_name: 'func-test-new-ag',
azure_location: 'West US')
rsp.at_css('Status').should_not be_nil
rsp.at_css('Status').content.should eq('Succeeded')
end
specify { @connection.ags.exists?('notexist').should eq(false) }
specify { @connection.ags.exists?('func-test-new-ag').should eq(true) }
it 'run through' do
@connection.ags.all.each do |ag|
ag.name.should_not be_nil
ag.location.should_not be_nil
end
end
end

Просмотреть файл

@ -0,0 +1,30 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe 'vnets' do
before(:all) do
@connection = Azure::Connection.new(TEST_PARAMS)
@connection.ags.create(azure_ag_name: 'func-test-agforvnet',
azure_location: 'West US')
end
it 'create' do
rsp = @connection.vnets.create(
azure_vnet_name: 'func-test-new-vnet',
azure_ag_name: 'func-test-agforvnet',
azure_address_space: '10.0.0.0/16')
rsp.at_css('Status').should_not be_nil
rsp.at_css('Status').content.should eq('Succeeded')
end
specify { @connection.vnets.exists?('notexist').should eq(false) }
specify { @connection.vnets.exists?('func-test-new-vnet').should eq(true) }
it 'run through' do
@connection.vnets.all.each do |vnet|
vnet.name.should_not be_nil
vnet.affinity_group.should_not be_nil
vnet.state.should_not be_nil
end
end
end