Skip to content

Commit

Permalink
Comment out more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davitmamrikishvili committed Sep 16, 2024
1 parent 74b2467 commit 4b0eeff
Showing 1 changed file with 66 additions and 66 deletions.
132 changes: 66 additions & 66 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List

from th2_data_services.utils.pandas.aggregate import aggregate_by_fields
# from th2_data_services.utils.pandas.aggregate import aggregate_by_fields
from th2_data_services.utils.pandas.utils import search_fields, append_total_rows, delete_string_by_pattern, find_tag_in_string


Expand Down Expand Up @@ -46,71 +46,71 @@ def test_search_fields_with_complex_body(complex_body: List[dict]):
}


def test_append_total_rows_not_change(data_for_analyzing: List[dict]):
statistics = aggregate_by_fields(
data_for_analyzing, "eventName", "type", "successful"
)

statistics_with_total = append_total_rows(statistics, {"count": "sum"})
statistics_without_total = append_total_rows(statistics, {})

assert not statistics_with_total.equals(statistics_without_total)


def test_append_total_rows(data_for_analyzing: List[dict]):
statistics = aggregate_by_fields(
data_for_analyzing, "eventName", "type", "successful"
)
statistics = append_total_rows(statistics, {"count": "sum"})

assert statistics.to_dict() == {
"count": {
("heartbeat", "Heartbeat", False): 2.0,
("heartbeat", "Heartbeat", True): 1.0,
("heartbeat", "Heartbeat", "total"): 3.0,
("message", "Send message", False): 1.0,
("message", "Send message", "total"): 1.0,
("message 333", "Receive message", False): 1.0,
("message 333", "Receive message", "total"): 1.0,
("message 333", "Send message", True): 1.0,
("message 333", "Send message", "total"): 1.0,
("message 444", "Receive message", False): 1.0,
("message 444", "Receive message", True): 1.0,
("message 444", "Receive message", "total"): 2.0,
("message 444", "Send message", True): 1.0,
("message 444", "Send message", "total"): 1.0,
("message122", "Receive message", True): 1.0,
("message122", "Receive message", "total"): 1.0,
("message122", "Send message", True): 1.0,
("message122", "Send message", "total"): 1.0,
("message123", "Receive message", True): 1.0,
("message123", "Receive message", "total"): 1.0,
("message123", "Send message", True): 1.0,
("message123", "Send message", "total"): 1.0,
("test case 1", "Test Case", True): 1.0,
("test case 1", "Test Case", "total"): 1.0,
("test case 2", "Test Case", True): 1.0,
("test case 2", "Test Case", "total"): 1.0,
("test case 3", "Test Case", False): 1.0,
("test case 3", "Test Case", "total"): 1.0,
("test case 4", "Test Case", True): 1.0,
("test case 4", "Test Case", "total"): 1.0,
("test run 1", "Test Run", True): 1.0,
("test run 1", "Test Run", "total"): 1.0,
("test run 2", "Test Run", False): 1.0,
("test run 2", "Test Run", "total"): 1.0,
("test run 3", "Test Case", True): 1.0,
("test run 3", "Test Case", "total"): 1.0,
("test run 4", "Test Run", False): 1.0,
("test run 4", "Test Run", "total"): 1.0,
("verification", "Verification", True): 1.0,
("verification", "Verification", "total"): 1.0,
("verification32", "Verification", True): 1.0,
("verification32", "Verification", "total"): 1.0,
("verification33", "Verification", False): 1.0,
("verification33", "Verification", "total"): 1.0,
}
}
# def test_append_total_rows_not_change(data_for_analyzing: List[dict]):
# statistics = aggregate_by_fields(
# data_for_analyzing, "eventName", "type", "successful"
# )
#
# statistics_with_total = append_total_rows(statistics, {"count": "sum"})
# statistics_without_total = append_total_rows(statistics, {})
#
# assert not statistics_with_total.equals(statistics_without_total)
#
#
# def test_append_total_rows(data_for_analyzing: List[dict]):
# statistics = aggregate_by_fields(
# data_for_analyzing, "eventName", "type", "successful"
# )
# statistics = append_total_rows(statistics, {"count": "sum"})
#
# assert statistics.to_dict() == {
# "count": {
# ("heartbeat", "Heartbeat", False): 2.0,
# ("heartbeat", "Heartbeat", True): 1.0,
# ("heartbeat", "Heartbeat", "total"): 3.0,
# ("message", "Send message", False): 1.0,
# ("message", "Send message", "total"): 1.0,
# ("message 333", "Receive message", False): 1.0,
# ("message 333", "Receive message", "total"): 1.0,
# ("message 333", "Send message", True): 1.0,
# ("message 333", "Send message", "total"): 1.0,
# ("message 444", "Receive message", False): 1.0,
# ("message 444", "Receive message", True): 1.0,
# ("message 444", "Receive message", "total"): 2.0,
# ("message 444", "Send message", True): 1.0,
# ("message 444", "Send message", "total"): 1.0,
# ("message122", "Receive message", True): 1.0,
# ("message122", "Receive message", "total"): 1.0,
# ("message122", "Send message", True): 1.0,
# ("message122", "Send message", "total"): 1.0,
# ("message123", "Receive message", True): 1.0,
# ("message123", "Receive message", "total"): 1.0,
# ("message123", "Send message", True): 1.0,
# ("message123", "Send message", "total"): 1.0,
# ("test case 1", "Test Case", True): 1.0,
# ("test case 1", "Test Case", "total"): 1.0,
# ("test case 2", "Test Case", True): 1.0,
# ("test case 2", "Test Case", "total"): 1.0,
# ("test case 3", "Test Case", False): 1.0,
# ("test case 3", "Test Case", "total"): 1.0,
# ("test case 4", "Test Case", True): 1.0,
# ("test case 4", "Test Case", "total"): 1.0,
# ("test run 1", "Test Run", True): 1.0,
# ("test run 1", "Test Run", "total"): 1.0,
# ("test run 2", "Test Run", False): 1.0,
# ("test run 2", "Test Run", "total"): 1.0,
# ("test run 3", "Test Case", True): 1.0,
# ("test run 3", "Test Case", "total"): 1.0,
# ("test run 4", "Test Run", False): 1.0,
# ("test run 4", "Test Run", "total"): 1.0,
# ("verification", "Verification", True): 1.0,
# ("verification", "Verification", "total"): 1.0,
# ("verification32", "Verification", True): 1.0,
# ("verification32", "Verification", "total"): 1.0,
# ("verification33", "Verification", False): 1.0,
# ("verification33", "Verification", "total"): 1.0,
# }
# }


def test_delete_string_by_pattern():
Expand Down

0 comments on commit 4b0eeff

Please sign in to comment.