Skip to content

Commit

Permalink
Merge branch 'fix/network_tests' into 'main'
Browse files Browse the repository at this point in the history
fix: Fix hardcoded values to variables

See merge request espressif/idf-component-manager!490
  • Loading branch information
hfudev committed Feb 19, 2025
2 parents af7e08f + 5d029de commit d93b1bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/sources/test_web_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ def test_cache_path(self):
@use_vcr_or_real_env('tests/fixtures/vcr_cassettes/test_fetch_webservice.yaml')
@pytest.mark.network
def test_download(self, monkeypatch, release_component_path, tmp_path):
original_registry = os.getenv('IDF_COMPONENT_REGISTRY_URL', 'http://localhost:5000')
monkeypatch.setenv('IDF_COMPONENT_REGISTRY_URL', 'http://example.com')

cache_dir = str(tmp_path / 'cache')
monkeypatch.setenv('IDF_COMPONENT_CACHE_PATH', cache_dir)

source = WebServiceSource(
registry_url='http://localhost:5000', # use a different registry_url for testing
registry_url=original_registry, # use a different registry_url for testing
system_cache_path=cache_dir,
)
cmp = SolvedComponent(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def test_user_agent(self):

@use_vcr_or_real_env('tests/fixtures/vcr_cassettes/test_api_information.yaml')
@pytest.mark.network
def test_api_information(self, registry_url):
def test_api_information(self, registry_url, storage_url):
client = APIClient(registry_url=registry_url)
information = client.api_information()
assert information['components_base_url'] == 'http://localhost:9000/test-public'
assert information['components_base_url'] == storage_url

def test_file_adapter(self, fixtures_path):
storage_url = f'file://{fixtures_path}'
Expand Down

0 comments on commit d93b1bb

Please sign in to comment.