test(init.py): improving testing for get_model_cost_map

b69449a811
This commit is contained in:
Krrish Dholakia 2023-10-18 14:55:36 -07:00
parent 1ba4297d09
commit 50a3c9768b
2 changed files with 4 additions and 3 deletions

View file

@ -46,7 +46,8 @@ client_session: Optional[requests.Session] = None
model_fallbacks: Optional[List] = None model_fallbacks: Optional[List] = None
############################################# #############################################
def get_model_cost_map(): def get_model_cost_map(url: Optional[str]=None):
if url is None:
url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json" url = "https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json"
try: try:
response = requests.get(url) response = requests.get(url)

View file

@ -7,6 +7,6 @@ import litellm
import pytest import pytest
try: try:
print(litellm.get_model_cost_map()) print(litellm.get_model_cost_map(url="fake-url"))
except Exception as e: except Exception as e:
pytest.fail(f"An exception occurred: {e}") pytest.fail(f"An exception occurred: {e}")