Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
bgaidioz committed Sep 10, 2024
1 parent 2559b5a commit 3053042
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LocationPackageTest extends SnapiTestContext {
| Collection.Count(data)
|""".stripMargin)(it => it should evaluateTo("7"))

test(s"""Location.Ll("s3://$UnitTestPublicBucket/publications/").url""") { it =>
test(s"""List.Transform(Location.Ls("s3://$UnitTestPublicBucket/publications/"), x -> String.From(x))""") { it =>
it should evaluateTo("""Collection.Build(
| "s3://rawlabs-public-test-data/publications/authors.parquet",
| "s3://rawlabs-public-test-data/publications/authors.hjson",
Expand Down Expand Up @@ -99,4 +99,16 @@ class LocationPackageTest extends SnapiTestContext {
test(s"""String.Read(S3.Build("$UnitTestPrivateBucket2", "/file1.csv"))
|""".stripMargin)(it => it should evaluateTo(""" "foobar" """))

test(s"""let dir = S3.Build(
| "$UnitTestPrivateBucket", "/publications/publications-hjson/*.json",
| region = "${UnitTestPrivateBucketCred.getRegion}",
| accessKey = "${UnitTestPrivateBucketCred.getAccessSecretKey.getAccessKey}",
| secretKey = "${UnitTestPrivateBucketCred.getAccessSecretKey.getSecretKey}"
| ),
| files = Location.Ls(dir),
| lines = List.Unnest(files, f -> List.From(String.ReadLines(f)))
|in
| List.Count(lines)
|""".stripMargin)(it => it should evaluateTo("1000"))

}

0 comments on commit 3053042

Please sign in to comment.