Skip to content

Commit

Permalink
Fixing error for local files (#5236)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Dumas <simon.dumas@epfl.ch>
  • Loading branch information
imsdu and Simon Dumas authored Nov 18, 2024
1 parent e6dbb51 commit 80b78da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object FileCopier {
logError(logger, "s3Copy")
)

def localDiskPath(relative: Path): String = Paths.get(URI.create(s"file:/$relative")).toString
def localDiskPath(relative: Path): String = Paths.get(URI.create(s"file:/$relative")).toString.drop(1)

sealed trait FileCopyResult extends Product with Serializable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class RunShipSuite
// Directory, should be skipped
directoryId = iri"https://bbp.epfl.ch/neurosciencegraph/data/directory"
_ <- checkFor("file", directoryId, xas).assertEquals(0)
// Summary S3 check, 4 objects should have been imported in total
// Summary S3 check, 5 objects should have been imported in total
_ <- s3Client.listObjectsV2(targetBucket).map(_.keyCount().intValue()).assertEquals(5)
// Summary report check, only the directory event should have been skipped
_ = assertEquals(report.progress(Files.entityType).success, 6L)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FileProcessorSuite extends NexusSuite {
test("Correctly decode a local path") {
val encoded = Uri.Path("org/proj/9/f/0/3/2/4/f/e/0925_Rhi13.3.13%20cell%201+2%20(superficial).asc")
val obtained = localDiskPath(encoded)
val expected = "/org/proj/9/f/0/3/2/4/f/e/0925_Rhi13.3.13 cell 1+2 (superficial).asc"
val expected = "org/proj/9/f/0/3/2/4/f/e/0925_Rhi13.3.13 cell 1+2 (superficial).asc"
assertEquals(obtained, expected)
}

Expand Down

0 comments on commit 80b78da

Please sign in to comment.