Skip to content

Commit

Permalink
added binary file download to test case of download without serializa…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
nlw0 committed Jun 6, 2023
1 parent ea00706 commit 7298551
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/nocredentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ using JSON
creds = NoCredentials()

session = GoogleSession(creds, ["devstorage.full_control"])

## Test download of JSON data from Pong dataset
bucketName = "atari-replay-datasets"
prefix="dqn/Pong/1/replay_logs/\$store\$_action"

Expand All @@ -17,6 +19,13 @@ end

EXPECTED_PARITY = 0xf1

@testset "NoCredentials" begin
## Test download of binary data from sentinel dataset
sentinelbucket = "gcp-public-data-sentinel-2"
sentinelpath = "L2/tiles/32/T/NS/S2A_MSIL2A_20210506T102021_N0300_R065_T32TNS_20210506T132458.SAFE/GRANULE/L2A_T32TNS_A030664_20210506T102022/IMG_DATA/R20m/T32TNS_20210506T102021_B07_20m.jp2"
sentinelimage = GoogleCloud.storage(:Object, :get, sentinelbucket, sentinelpath; session)
EXPECTED_PARITY_SENTINEL = 0x6e

@testset "storage access and NoCredentials" begin
@test reduce(, fetch.(parities)) == EXPECTED_PARITY
@test reduce(, sentinelimage) == EXPECTED_PARITY_SENTINEL
end

0 comments on commit 7298551

Please sign in to comment.