Skip to content

Commit

Permalink
Fix For Hard Coded URL In Pytest (#1463)
Browse files Browse the repository at this point in the history
* Merge sample command with the example command (#1422)

* Merge sample command with the example command

* Fix example command usage

* Generalize Standard Run  (#1411)

* Modify header calculation to choose from predefined example output file or standard example output file

* Remove the readiness function from SCRA because it is redundant, since those checks are also performed by the amenable function

* Remove unused method

* Make csv serialization work for any kind of model api response

* Remove the standard flag from the CLI since it is now the default run

* Update tests

* Unnecessary files removed

* Unnecessary files removed

* Unnecessary files removed

* Unnecessary files removed

* Unnecessary files removed

* Some import cleanup

* fix: hard coded url in pytest fixd

---------

Co-authored-by: Dhanshree Arora <[email protected]>
  • Loading branch information
Abellegese and DhanshreeA authored Dec 19, 2024
1 parent d798a25 commit 84227be
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/test_url_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

ji = JsonModelsInterface(config_json=None)

import pytest

MODEL_ID = "eos9ei3"

class OriginalModelFinder:
def __init__(self):
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 84227be

Please sign in to comment.