Skip to main content
View module source on GitHub

FalsyCache

A cache that evaluates to False but is not None - used to test the ‘cache is not None’ fix.

TestMaximCacheHandling

Test the cache handling changes, specifically the ‘if cache is not None:’ fix.

setUp

Set up test fixtures.

tearDown

Clean up after tests.

test_enable_prompt_management_with_none_cache

Test enable_prompt_management with cache=None.

test_enable_prompt_management_with_falsy_cache

Test enable_prompt_management with a cache that evaluates to False but is not None. This tests the fix from ‘if cache:’ to ‘if cache is not None:’. Previously, a falsy cache would not be used even if it was a valid cache object.

test_enable_prompt_management_with_valid_cache

Test enable_prompt_management with a normal valid cache.

test_enable_prompt_management_starts_sync_thread

Test that enable_prompt_management starts the sync thread.

test_enable_exceptions_method_chaining

Test enable_exceptions method returns self for chaining.

TestMaximInitialization

Test Maxim initialization and configuration.

setUp

Set up test fixtures.

tearDown

Clean up after tests.

test_maxim_requires_api_key

Test that Maxim requires an API key.

test_maxim_uses_env_api_key

Test that Maxim uses environment variable for API key.

test_maxim_singleton_pattern

Test that Maxim follows singleton pattern.

test_maxim_default_cache_creation

Test that Maxim creates default cache when none provided.

test_cleanup_method_stops_running

Test that cleanup method properly sets is_running to False.

test_cleanup_prevents_double_execution

Test that cleanup method can be called multiple times safely.

TestGetConfigDict

Test the get_config_dict function.

test_get_config_dict_with_config_object

Test get_config_dict function with Config object.

test_get_config_dict_with_dict

Test get_config_dict function with dictionary.