From 5d71c8b28155c2f0a3311376b841bec65b7d0322 Mon Sep 17 00:00:00 2001 From: Jack Nam <30609178+thienlnam@users.noreply.github.com> Date: Mon, 9 Sep 2024 20:06:21 -0700 Subject: [PATCH] Try adding ggignore --- test/conftest.py | 2 +- test/oai/test_utils.py | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 0eb742fe9c28..b27e67e3e465 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -4,7 +4,7 @@ skip_redis = False skip_docker = False reason = "requested to skip" -MOCK_OPEN_AI_API_KEY = "sk-mockopenaiAPIkeyinexpectedformatfortestingonly" +MOCK_OPEN_AI_API_KEY = "sk-mockopenaiAPIkeyinexpectedformatfortestingonly" # ggignore # Registers command-line options like '--skip-openai' and '--skip-redis' via pytest hook. diff --git a/test/oai/test_utils.py b/test/oai/test_utils.py index 6bfe411511f4..87d749d80304 100755 --- a/test/oai/test_utils.py +++ b/test/oai/test_utils.py @@ -420,20 +420,21 @@ def test_is_valid_api_key(): assert not is_valid_api_key("SK-") assert not is_valid_api_key("sk-asajsdjsd2") assert not is_valid_api_key("FooBar") - assert not is_valid_api_key("sk-asajsdjsd22372%23kjdfdfdf2329ffUUDSDS") - assert is_valid_api_key("sk-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS") - assert is_valid_api_key("sk-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS1212121221212sssXX") - assert is_valid_api_key("sk-proj-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-0-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-None-sajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-svcacct-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-svcacct-asajsdjsd22372X23kjdfdf_f2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-aut0gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-aut0-gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert is_valid_api_key("sk-aut0--gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert not is_valid_api_key("sk-aut0-gen--asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") - assert not is_valid_api_key("sk-abc_def-ghijklmnopqrstuvwxyz0123456789ABCDEFGH") - assert not is_valid_api_key("sk--aut0-gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") + assert not is_valid_api_key("sk-asajsdjsd22372%23kjdfdfdf2329ffUUDSDS") # ggignore + assert is_valid_api_key("sk-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS") # ggignore + assert is_valid_api_key("sk-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS1212121221212sssXX") # ggignore + assert is_valid_api_key("sk-proj-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-0-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-None-sajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-svcacct-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-svcacct-asajsdjsd22372X23kjdfdf_f2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-proj-asajsdjsd22372X23kjdfdf_f2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-aut0gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-aut0-gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert is_valid_api_key("sk-aut0--gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert not is_valid_api_key("sk-aut0-gen--asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore + assert not is_valid_api_key("sk-abc_def-ghijklmnopqrstuvwxyz0123456789ABCDEFGH") # ggignore + assert not is_valid_api_key("sk--aut0-gen-asajsdjsd22372X23kjdfdfdf2329ffUUDSDS12121212212") # ggignore assert is_valid_api_key(MOCK_OPEN_AI_API_KEY)