Skip to content

Commit 729ab4a

Browse files
test: Remove redundant URL tests from test_object.py
The TestRemoteURLSupport class tested is_remote_url and parse_remote_url which were renamed to is_url and parse_url. These tests are now redundant as comprehensive coverage exists in tests/unit/test_storage_urls.py. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent abebba9 commit 729ab4a

File tree

1 file changed

+0
-89
lines changed

1 file changed

+0
-89
lines changed

tests/integration/test_object.py

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -761,92 +761,3 @@ def test_staged_insert_missing_pk_raises(self, schema_obj, mock_object_storage):
761761
staged.store("data_file", ".dat")
762762

763763

764-
class TestRemoteURLSupport:
765-
"""Tests for remote URL detection and parsing."""
766-
767-
def test_is_remote_url_s3(self):
768-
"""Test S3 URL detection."""
769-
from datajoint.storage import is_remote_url
770-
771-
assert is_remote_url("s3://bucket/path/file.dat") is True
772-
assert is_remote_url("S3://bucket/path/file.dat") is True
773-
774-
def test_is_remote_url_gcs(self):
775-
"""Test GCS URL detection."""
776-
from datajoint.storage import is_remote_url
777-
778-
assert is_remote_url("gs://bucket/path/file.dat") is True
779-
assert is_remote_url("gcs://bucket/path/file.dat") is True
780-
781-
def test_is_remote_url_azure(self):
782-
"""Test Azure URL detection."""
783-
from datajoint.storage import is_remote_url
784-
785-
assert is_remote_url("az://container/path/file.dat") is True
786-
assert is_remote_url("abfs://container/path/file.dat") is True
787-
788-
def test_is_remote_url_http(self):
789-
"""Test HTTP/HTTPS URL detection."""
790-
from datajoint.storage import is_remote_url
791-
792-
assert is_remote_url("http://example.com/path/file.dat") is True
793-
assert is_remote_url("https://example.com/path/file.dat") is True
794-
795-
def test_is_remote_url_local_path(self):
796-
"""Test local paths are not detected as remote."""
797-
from datajoint.storage import is_remote_url
798-
799-
assert is_remote_url("/local/path/file.dat") is False
800-
assert is_remote_url("relative/path/file.dat") is False
801-
assert is_remote_url("C:\\Windows\\path\\file.dat") is False
802-
803-
def test_is_remote_url_non_string(self):
804-
"""Test non-string inputs return False."""
805-
from datajoint.storage import is_remote_url
806-
807-
assert is_remote_url(None) is False
808-
assert is_remote_url(123) is False
809-
assert is_remote_url(Path("/local/path")) is False
810-
811-
def test_parse_remote_url_s3(self):
812-
"""Test S3 URL parsing."""
813-
from datajoint.storage import parse_remote_url
814-
815-
protocol, path = parse_remote_url("s3://bucket/path/file.dat")
816-
assert protocol == "s3"
817-
assert path == "bucket/path/file.dat"
818-
819-
def test_parse_remote_url_gcs(self):
820-
"""Test GCS URL parsing."""
821-
from datajoint.storage import parse_remote_url
822-
823-
protocol, path = parse_remote_url("gs://bucket/path/file.dat")
824-
assert protocol == "gcs"
825-
assert path == "bucket/path/file.dat"
826-
827-
protocol, path = parse_remote_url("gcs://bucket/path/file.dat")
828-
assert protocol == "gcs"
829-
assert path == "bucket/path/file.dat"
830-
831-
def test_parse_remote_url_azure(self):
832-
"""Test Azure URL parsing."""
833-
from datajoint.storage import parse_remote_url
834-
835-
protocol, path = parse_remote_url("az://container/path/file.dat")
836-
assert protocol == "abfs"
837-
assert path == "container/path/file.dat"
838-
839-
def test_parse_remote_url_http(self):
840-
"""Test HTTP URL parsing."""
841-
from datajoint.storage import parse_remote_url
842-
843-
protocol, path = parse_remote_url("https://example.com/path/file.dat")
844-
assert protocol == "https"
845-
assert path == "example.com/path/file.dat"
846-
847-
def test_parse_remote_url_unsupported(self):
848-
"""Test unsupported protocol raises error."""
849-
from datajoint.storage import parse_remote_url
850-
851-
with pytest.raises(dj.DataJointError, match="Unsupported remote URL"):
852-
parse_remote_url("ftp://server/path/file.dat")

0 commit comments

Comments
 (0)