Skip to content

Commit

Permalink
Add tests for is_same_url()
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Mar 5, 2024
1 parent 1610bf9 commit e58df62
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dandi/tests/test_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .fixtures import DandiAPI, SampleDandiset
from ..consts import DRAFT, dandiset_metadata_file
from ..dandiapi import RESTFullAPIClient
from ..delete import delete
from ..delete import delete, is_same_url
from ..download import download
from ..exceptions import NotFoundError
from ..utils import list_paths
Expand Down Expand Up @@ -439,3 +439,16 @@ def test_delete_zarr_path(
assert list_paths(tmp_path) == [
tmp_path / zarr_dandiset.dandiset_id / "dandiset.yaml"
]


@pytest.mark.parametrize(
"url1,url2,r",
[
("https://example.com/api", "https://example.com/api/", True),
("https://example.com/api", "http://example.com/api", False),
("https://example.com/api", "HTTPS://EXAMPLE.COM/api", True),
("https://example.珠宝/api", "https://example.xn--pbt977c/api", True),
],
)
def test_is_same_url(url1: str, url2: str, r: bool) -> None:
assert is_same_url(url1, url2) is r

Check warning on line 454 in dandi/tests/test_delete.py

View check run for this annotation

Codecov / codecov/patch

dandi/tests/test_delete.py#L454

Added line #L454 was not covered by tests

0 comments on commit e58df62

Please sign in to comment.