Skip to content

Commit

Permalink
Add comments to generic resolver tests with cache metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcad committed Dec 5, 2024
1 parent 6d4ba4e commit 7665500
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,8 @@ def test_resolve_generic_and_multiple_match_first_only(self):
assert document == expected

def test_resolve_from_cache_with_large_enough_cache(self):
"""The metrics are mocked and their values are the sum of previously added cache values,
instead of being the current cache values."""
config = deepcopy(self.CONFIG)
config["max_cache_entries"] = 10
self.object = Factory.create({"generic_resolver": config})
Expand Down Expand Up @@ -526,6 +528,8 @@ def test_resolve_from_cache_with_large_enough_cache(self):
assert self.object.metrics.num_cache_entries == 4

def test_resolve_from_cache_with_cache_smaller_than_results(self):
"""The metrics are mocked and their values are the sum of previously added cache values,
instead of being the current cache values."""
config = deepcopy(self.CONFIG)
config["max_cache_entries"] = 1
self.object = Factory.create({"generic_resolver": config})
Expand Down Expand Up @@ -602,6 +606,8 @@ def test_resolve_without_cache(self):
assert self.object.metrics.num_cache_entries == 0

def test_resolve_from_cache_with_update_interval_2(self):
"""The metrics are mocked and their values are the sum of previously added cache values,
instead of being the current cache values."""
config = deepcopy(self.CONFIG)
config["cache_metrics_interval"] = 2
config["max_cache_entries"] = 10
Expand Down

0 comments on commit 7665500

Please sign in to comment.