def test_execute_valid_plugin(self): """Test that execute plugin works properly""" p = VogelerPlugin(plugin_dir=os.path.dirname(__file__)+'/fixtures/plugins/') results = p.execute_plugin('facter') syskey_subset = {'syskey' : node()} format_subset = {'format' : 'yaml'} self.assertType(results, 'dict') self.assertDictContainsSubset(syskey_subset, results) self.assertDictContainsSubset(format_subset, results)
def test_execute_valid_plugin(self): """Test that execute plugin works properly""" p = VogelerPlugin(plugin_dir=os.path.dirname(__file__) + '/fixtures/plugins/') results = p.execute_plugin('facter') syskey_subset = {'syskey': node()} format_subset = {'format': 'yaml'} self.assertType(results, 'dict') self.assertDictContainsSubset(syskey_subset, results) self.assertDictContainsSubset(format_subset, results)
def test_execute_failing_plugin(self): """Test that execute does NOT work with a broken plugin""" with self.assertRaises(VogelerException): p = VogelerPlugin(plugin_dir=os.path.dirname(__file__) + '/fixtures/plugins/') p.execute_plugin('broken')
def test_execute_unauth_plugin(self): """Test that execute does NOT work with an unauthorized plugin""" with self.assertRaises(VogelerException): p = VogelerPlugin() p.execute_plugin('invalid')
def test_execute_failing_plugin(self): """Test that execute does NOT work with a broken plugin""" with self.assertRaises(VogelerException): p = VogelerPlugin(plugin_dir=os.path.dirname(__file__)+'/fixtures/plugins/') p.execute_plugin('broken')