From 514d00294a6d6aac429bb48072b999ea14f600b8 Mon Sep 17 00:00:00 2001 From: Daniel Lenton Date: Thu, 7 Nov 2024 11:51:35 +0000 Subject: [PATCH] added add_log_entries to test_logging. --- tests/test_evals/test_utils/test_logging.py | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_evals/test_utils/test_logging.py b/tests/test_evals/test_utils/test_logging.py index 5cc721b..958de0d 100644 --- a/tests/test_evals/test_utils/test_logging.py +++ b/tests/test_evals/test_utils/test_logging.py @@ -373,6 +373,28 @@ def test_log_caching(): ) msg = unify.add_log_params(logs=log, p="p") assert msg == {"info": "Logs updated successfully!"} + # add_log_params + unify.add_log_params(logs=log, p="p") + assert ( + _get_cache( + fn_name="add_log_params", + kw={"logs": log, "p": "p"}, + ) + is not None + ) + msg = unify.add_log_params(logs=log, p="p") + assert msg == {"info": "Logs updated successfully!"} + # add_log_entries + unify.add_log_entries(logs=log, e="e") + assert ( + _get_cache( + fn_name="add_log_entries", + kw={"logs": log, "e": "e"}, + ) + is not None + ) + msg = unify.add_log_entries(logs=log, e="e") + assert msg == {"info": "Logs updated successfully!"} if __name__ == "__main__":