Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.

Commit c9349b3

Browse files
author
Guihao Liang
authored
add sarray test (#3110)
* add more test
1 parent b598e95 commit c9349b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/python/turicreate/test/test_sframe_s3.py renamed to src/python/turicreate/test/test_io_s3.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from __future__ import division as _ # noqa
99
from __future__ import absolute_import as _ # noqa
1010
from ..data_structures.sframe import SFrame
11+
from ..data_structures.sarray import SArray
1112
from turicreate.util import _assert_sframe_equal
1213

1314
import tempfile
@@ -22,6 +23,7 @@
2223
# 64MB is the cache block size. The big sframe with 77MB is used to
2324
# ensure there's no issues when crossing different cache blocks.
2425
remote_sframe_folders = ["small_sframe_dc", "medium_sframe_ac", "big_sframe_od"]
26+
remote_sarray_folders = ["tiny_array"]
2527

2628

2729
@pytest.mark.skipif(
@@ -40,6 +42,7 @@ def setup_class(self):
4042
self.bucket = "tc_qa"
4143
self.s3_root_prefix = "integration/manual/"
4244
self.s3_sframe_prefix = os.path.join(self.s3_root_prefix, "sframes/")
45+
self.s3_sarray_prefix = os.path.join(self.s3_root_prefix, "sarrays/")
4346

4447
# download all related files once
4548
self.downloaded_files = dict()
@@ -105,6 +108,13 @@ def test_s3_sframe_download(self, folder):
105108
sf_from_s3 = SFrame(s3_url)
106109
_assert_sframe_equal(sf_from_disk, sf_from_s3)
107110

111+
@pytest.mark.parametrize("folder", remote_sarray_folders)
112+
def test_s3_sarray_download(self, folder):
113+
s3_url = os.path.join("s3://", self.bucket, self.s3_sarray_prefix, folder)
114+
array = SArray(s3_url)
115+
assert len(array) == 1
116+
assert array[0] == 1
117+
108118
@pytest.mark.parametrize("folder", remote_sframe_folders)
109119
def test_s3_sframe_upload(self, folder):
110120
# s3 only writes when it receives all parts

0 commit comments

Comments
 (0)