def test_redis_tracker_store_valid_key_prefix(default_domain: Domain): test_valid_key_prefix = "spanish" tracker_store = RedisTrackerStore( domain=default_domain, host="localhost", port=6379, db=0, password="******", key_prefix=test_valid_key_prefix, record_exp=3000, ) assert (tracker_store._get_key_prefix( ) == f"{test_valid_key_prefix}:{DEFAULT_REDIS_TRACKER_STORE_KEY_PREFIX}")
def test_redis_tracker_store_invalid_key_prefix(domain: Domain): test_invalid_key_prefix = "$$ &!" tracker_store = RedisTrackerStore( domain=domain, host="localhost", port=6379, db=0, password="******", key_prefix=test_invalid_key_prefix, record_exp=3000, ) assert tracker_store._get_key_prefix() == DEFAULT_REDIS_TRACKER_STORE_KEY_PREFIX