def test_add(self): ''' Tests if specified group was added ''' mock_ret = MagicMock(return_value=0) with patch.dict(mac_group.__salt__, {'cmd.retcode': mock_ret}): self.assertTrue(mac_group.add('test', 500))
def test_add(self): ''' Tests if specified group was added ''' mock_ret = MagicMock(return_value=0) with patch.dict(mac_group.__salt__, {'cmd.retcode': mock_ret}), \ patch('salt.modules.mac_group.info', MagicMock(return_value={})), \ patch('salt.modules.mac_group._list_gids', MagicMock(return_value=[])): self.assertTrue(mac_group.add('test', 500))
def test_add(): """ Tests if specified group was added """ mock_ret = MagicMock(return_value=0) with patch.dict(mac_group.__salt__, {"cmd.retcode": mock_ret}), patch( "salt.modules.mac_group.info", MagicMock(return_value={}) ), patch("salt.modules.mac_group._list_gids", MagicMock(return_value=[])): assert mac_group.add("test", 500)