def test_get_syslog_config_success(self): ''' Tests successful function return for a single ESXi host. ''' self.assertEqual({HOST: { 'success': True }}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
def test_get_syslog_config_host_list_success(self): ''' Tests successful function return when an esxi_host is provided. ''' host_1 = 'host_1.foo.com' self.assertEqual({host_1: {'success': True}}, vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
def test_get_syslog_config_success(self): ''' Tests successful function return for a single ESXi host. ''' with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 0, 'stdout': ''})): self.assertEqual({HOST: {'success': True}}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
def test_get_syslog_config_host_list_bad_retcode(self): ''' Tests error message returned with list of esxi_hosts. ''' host_1 = 'host_1.foo.com' self.assertEqual({host_1: {'message': ERROR, 'success': False}}, vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
def test_get_syslog_config_bad_retcode(self): ''' Tests error message given for a single ESXi host. ''' with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 1, 'stdout': ERROR})): self.assertEqual({HOST: {'message': ERROR, 'success': False}}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
def test_get_syslog_config_bad_retcode(self): ''' Tests error message given for a single ESXi host. ''' self.assertEqual({HOST: { 'message': ERROR, 'success': False }}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
def test_get_syslog_config_host_list_success(self): ''' Tests successful function return when an esxi_host is provided. ''' with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 0, 'stdout': ''})): host_1 = 'host_1.foo.com' self.assertEqual({host_1: {'success': True}}, vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
def test_get_syslog_config_host_list_bad_retcode(self): ''' Tests error message returned with list of esxi_hosts. ''' with patch('salt.utils.vmware.esxcli', MagicMock(return_value={'retcode': 1, 'stdout': ERROR})): host_1 = 'host_1.foo.com' self.assertEqual({host_1: {'message': ERROR, 'success': False}}, vsphere.get_syslog_config(HOST, USER, PASSWORD, esxi_hosts=[host_1]))
def test_get_syslog_config_success(self): ''' Tests successful function return for a single ESXi host. ''' self.assertEqual({HOST: {'success': True}}, vsphere.get_syslog_config(HOST, USER, PASSWORD))
def test_get_syslog_config_bad_retcode(self): ''' Tests error message given for a single ESXi host. ''' self.assertEqual({HOST: {'message': ERROR, 'success': False}}, vsphere.get_syslog_config(HOST, USER, PASSWORD))