diff --git a/test/test_url_search.py b/test/test_url_search.py index f9d546016..f8ed17f1d 100644 --- a/test/test_url_search.py +++ b/test/test_url_search.py @@ -3,8 +3,7 @@ ji = JsonModelsInterface(config_json=None) -import pytest - +MODEL_ID = "eos9ei3" class OriginalModelFinder: def __init__(self): @@ -59,7 +58,9 @@ def original_finder(): @pytest.fixture def actual_url(): - return "https://eos9ei3-tkreo.ondigitalocean.app/" + data = ji.items() + URL = next((item["Host URL"] for item in data if item["Identifier"] == MODEL_ID), None) + return URL @pytest.fixture @@ -68,20 +69,20 @@ def optimized_finder(): def test_original_finder(actual_url, original_finder): - url = original_finder._find_url_using_s3_models_json("eos9ei3") + url = original_finder._find_url_using_s3_models_json(MODEL_ID) assert url == actual_url def test_optimized_finder(actual_url, optimized_finder): - url = optimized_finder._find_url_using_s3_models_json("eos9ei3") + url = optimized_finder._find_url_using_s3_models_json(MODEL_ID) assert url == actual_url def test_benchmark_original(actual_url, benchmark, original_finder): - result = benchmark(original_finder._find_url_using_s3_models_json, "eos9ei3") + result = benchmark(original_finder._find_url_using_s3_models_json, MODEL_ID) assert result == actual_url def test_benchmark_optimized(actual_url, benchmark, optimized_finder): - result = benchmark(optimized_finder._find_url_using_s3_models_json, "eos9ei3") + result = benchmark(optimized_finder._find_url_using_s3_models_json, MODEL_ID) assert result == actual_url