def test_verify_flags(self, lf, a, o, i, res, err, capsys): with patch.object(Downloader, "__init__", lambda x, y, z: None): downloader = Downloader('', '') downloader.list_files = lf downloader.all_custom_content = a downloader.output_pack_path = o downloader.input_files = i answer = downloader.verify_flags() stdout, _ = capsys.readouterr() if err: assert err in stdout assert answer is res
def test_build_req_params(input, system, it, insecure, endpoint, req_type, req_body, monkeypatch): with patch.object(Downloader, "__init__", lambda x, y, z: None): monkeypatch.setenv('DEMISTO_BASE_URL', 'http://demisto.instance.com:8080/') monkeypatch.setenv('DEMISTO_API_KEY', 'API_KEY') downloader = Downloader('', '') downloader.system_item_type = it downloader.insecure = insecure downloader.input_files = input res_endpoint, res_req_type, res_req_body = downloader.build_req_params( ) assert endpoint == res_endpoint assert req_type == res_req_type assert req_body == res_req_body