def test_delete_agent(): """Tests for method delete_agent""" client = CBWApi(API_URL, API_KEY, SECRET_KEY) with vcr.use_cassette('spec/fixtures/vcr_cassettes/delete_agent.yaml'): response = client.delete_agent('5') assert response is True with vcr.use_cassette( 'spec/fixtures/vcr_cassettes/delete_agent_wrong_id.yaml'): response = client.delete_agent('wrong_id') assert response is False
"""Delete agent""" import os from configparser import ConfigParser from cbw_api_toolbox.cbw_api import CBWApi CONF = ConfigParser() CONF.read( os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'api.conf')) CLIENT = CBWApi(CONF.get('cyberwatch', 'url'), CONF.get('cyberwatch', 'api_key'), CONF.get('cyberwatch', 'secret_key')) AGENT_ID = '' CLIENT.delete_agent(AGENT_ID)