From ea401f3f6f39b79a1e9d657ecbe0daa780040a70 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 2 Feb 2022 22:22:27 +0900 Subject: [PATCH] gnocchi::db: Do not test behavior of lower libraries Current unit tests of gnocchi::db tests behavior of puppetlabs-mysql and puppetlabs-postgresql but this is not necessary and makes our maintenance difficult because we need to update our tests according to changes in lower libraries. This makes these unit tests assert only interfaces and stop testing behavior of these classes imported from libraries. Change-Id: I94744b06d37a3a6b28bf8ea09c1096e454676b12 --- spec/classes/gnocchi_db_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/classes/gnocchi_db_spec.rb b/spec/classes/gnocchi_db_spec.rb index 953c5901..fc7c72de 100644 --- a/spec/classes/gnocchi_db_spec.rb +++ b/spec/classes/gnocchi_db_spec.rb @@ -27,7 +27,7 @@ describe 'gnocchi::db' do { :database_connection => 'postgresql://gnocchi:gnocchi@localhost/gnocchi', } end - it { should contain_package('python-psycopg2').with_ensure('present') } + it { should contain_class('postgresql::lib::python') } end context 'with MySQL-python library as backend package' do @@ -37,7 +37,8 @@ describe 'gnocchi::db' do } end - it { should contain_package('python-mysqldb').with_ensure('present') } + it { should contain_class('mysql::bindings') } + it { should contain_class('mysql::bindings::python') } end context 'with incorrect database_connection string' do