Skip to content

Commit

Permalink
Try adding ggignore
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam committed Sep 10, 2024
1 parent fa67458 commit 5d71c8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 15 additions & 14 deletions test/oai/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit 5d71c8b

Please sign in to comment.