MCPcopy Create free account
hub / github.com/apache/arrow / test_filesystem_from_uri_s3

Function test_filesystem_from_uri_s3

python/pyarrow/tests/test_fs.py:1729–1744  ·  view source on GitHub ↗
(s3_server)

Source from the content-addressed store, hash-verified

1727
1728@pytest.mark.s3
1729def test_filesystem_from_uri_s3(s3_server):
1730 from pyarrow.fs import S3FileSystem
1731
1732 host, port, access_key, secret_key = s3_server['connection']
1733
1734 uri = f"s3://{access_key}:{secret_key}@mybucket/foo/bar?scheme=http&" \
1735 f"endpoint_override={host}:{port}&allow_bucket_creation=True"
1736
1737 fs, path = FileSystem.from_uri(uri)
1738 assert isinstance(fs, S3FileSystem)
1739 assert path == "mybucket/foo/bar"
1740
1741 fs.create_dir(path)
1742 [info] = fs.get_file_info([path])
1743 assert info.path == path
1744 assert info.type == FileType.Directory
1745
1746
1747@pytest.mark.gcs

Callers

nothing calls this directly

Calls 2

create_dirMethod · 0.45
get_file_infoMethod · 0.45

Tested by

no test coverage detected