def _mock_module(self): mock_module = Mock() mock_module.params = { 'gather_subset': self.gather_subset, 'gather_timeout': 5, 'filter': '*' } mock_module.get_bin_path = Mock(return_value=None) return mock_module
def mock_module(): mock_module = Mock() mock_module.params = { 'gather_subset': ['all'], 'gather_timeout': 5, 'filter': '*' } mock_module.get_bin_path = Mock(return_value=None) return mock_module
def _mock_module(self): mock_module = Mock() mock_module.params = { 'gather_subset': self.gather_subset, 'gather_timeout': 10, 'filter': '*' } mock_module.get_bin_path = Mock(return_value='/usr/sbin/capsh') mock_module.run_command = Mock(return_value=(0, 'Current: =ep', '')) return mock_module
def _mock_module(self): mock_module = Mock() mock_module.params = { 'gather_subset': self.gather_subset, 'gather_timeout': 10, 'filter': '*' } mock_module.get_bin_path = Mock(return_value='/not/actually/facter') mock_module.run_command = Mock(return_value=(0, facter_json_output, '')) return mock_module
def _mock_module(self): mock_module = Mock() mock_module.params = { 'gather_subset': self.gather_subset, 'gather_timeout': 10, 'filter': '*' } mock_module.get_bin_path = Mock(return_value='/usr/bin/lsb_release') mock_module.run_command = Mock( return_value=(0, lsb_release_a_fedora_output, '')) return mock_module
def mock_module(gather_subset=None, filter=None): if gather_subset is None: gather_subset = ['all', '!facter', '!ohai'] if filter is None: filter = '*' mock_module = Mock() mock_module.params = { 'gather_subset': gather_subset, 'gather_timeout': 5, 'filter': filter } mock_module.get_bin_path = Mock(return_value=None) return mock_module