mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-07 21:38:12 +08:00
#59 change s3 cache variable from S3_DISABLE_LISTINGS_CACHE to S3_ENABLE_LISTINGS_CACHE
This commit is contained in:
@@ -24,7 +24,10 @@ class TestScanDirectory(unittest.TestCase):
|
||||
)
|
||||
|
||||
@patch("s3fs.S3FileSystem")
|
||||
def test__GIVEN_multilevel_bucket_THEN_properly_recurses_suburls(self, s3func):
|
||||
@patch("flask.request")
|
||||
def test__GIVEN_multilevel_bucket_THEN_properly_recurses_suburls(
|
||||
self, requestMock, s3func
|
||||
):
|
||||
class S3Mock:
|
||||
def exists(path):
|
||||
if path in [
|
||||
@@ -38,7 +41,8 @@ class TestScanDirectory(unittest.TestCase):
|
||||
return True
|
||||
raise Exception("exists called with " + path)
|
||||
|
||||
def ls(path):
|
||||
def ls(path, refresh):
|
||||
assert refresh == True
|
||||
if path == "s3://my-bucket/":
|
||||
return [
|
||||
"my-bucket/lvl1",
|
||||
@@ -79,6 +83,7 @@ class TestScanDirectory(unittest.TestCase):
|
||||
raise Exception("isfile called with " + path)
|
||||
|
||||
s3func.return_value = S3Mock
|
||||
requestMock.args.get.return_value = "true"
|
||||
source = S3ItemSource("my-bucket")
|
||||
tree = source.scan_directory()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user