def test_disable_alerts(cbcsdk_mock): """Testing Watchlist.disable_alerts().""" api = cbcsdk_mock.api id = "watchlistId" cbcsdk_mock.mock_request("GET", f"/threathunter/watchlistmgr/v2/watchlist/{id}", WATCHLIST_GET_SPECIFIC_RESP) watchlist = Watchlist(api, model_unique_id="watchlistId") cbcsdk_mock.mock_request("DELETE", f"/threathunter/watchlistmgr/v3/orgs/test/watchlists/{id}/alert", None) watchlist.disable_alerts()
def test_disable_alerts_no_id(cbcsdk_mock): """Testing Watchlist.disable_alerts() raising InvalidObjectError when ID is missing.""" api = cbcsdk_mock.api watchlist = Watchlist(api, model_unique_id=None) with pytest.raises(InvalidObjectError): watchlist.disable_alerts()