Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2475,8 +2475,8 @@ def customer_usage_data_command():
)

else:
return_error("Unknown data type request. Precisely one of the following values needs to be set as data_type: "
"DAILY USAGE, MONTHLY USAGE, DATE RANGE USAGE, QUOTA LIMITS")
raise Exception("Unknown data type request. Precisely one of the following values needs to be set as data_type: "
"DAILY USAGE, MONTHLY USAGE, DATE RANGE USAGE, QUOTA LIMITS")

response_json = response.json()
results = customer_usage_data_output(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
url_latest_analyses_feed_output, url_analyses_feed_from_date_output, yara_ruleset_output, yara_retro_actions_output, \
format_proxy, domain_report_output, domain_downloaded_files_output, domain_urls_output, domain_to_ip_output, \
domain_related_domains_output, ip_report_output, ip_downloaded_files_output, ip_urls_output, ip_to_domain_output, \
network_reputation_output, detonate_url_output, url_dynamic_analysis_results_output
network_reputation_output, detonate_url_output, url_dynamic_analysis_results_output, customer_usage_data_output, \
customer_usage_yara_output
import demistomock as demisto
import pytest

Expand Down Expand Up @@ -366,3 +367,13 @@ def test_url_dynamic_analysis_results_output():
)

assert result.to_context() == test_context


def test_customer_data_output():
report = load_json("test_data/customer_usage_data.json")
result = customer_usage_data_output(data_type="MONTHLY USAGE", whole_company=False, response_json=report)

assert result.to_context().get("Contents").get("customer_usage_data").get("rl").get("month") == "2024-06"



Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"rl": {"month": "2024-06", "usage_report": [{"product": "TCA-0101 File Reputation", "number_of_queries": 37}, {"product": "TCA-0104 File Analysis - Hash", "number_of_queries": 76}, {"product": "TCA-9999", "number_of_queries": 10}]}}