Fix unit test for mistral::client class

Change-Id: I8f0e93c7594720cb4b68a9b3a2501ba8a6b223f7
This commit is contained in:
ZhongShengping 2017-08-03 10:13:27 +08:00
parent a7c72406fc
commit d72b2da1f1
1 changed files with 29 additions and 7 deletions

View File

@ -1,13 +1,35 @@
require 'spec_helper'
describe 'mistral::client' do
on_supported_os.each do |os, facts|
let(:facts) { facts }
context "on #{os}" do
it { is_expected.to contain_package('python-mistralclient')
.with(:ensure => 'present',
:tag => ['openstack',
'mistral-package']) }
shared_examples_for 'mistral client' do
it { is_expected.to contain_class('mistral::deps') }
it { is_expected.to contain_class('mistral::params') }
it 'installs mistral client package' do
is_expected.to contain_package('python-mistralclient').with(
:ensure => 'present',
:name => platform_params[:client_package],
:tag => ['openstack', 'mistral-package']
)
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
{ :client_package => 'python-mistralclient' }
end
it_behaves_like 'mistral client'
end
end
end