Skip to content

Commit

Permalink
Add more tests on wether the dataset was unzipped correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
frcroth committed Nov 4, 2024
1 parent 459ff77 commit 152acca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/e2e/End2EndSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ class End2EndSpec(arguments: Arguments) extends Specification with GuiceFakeAppl
truncateCommonPrefix = true,
excludeFromPrefix = None
)

// Test if the dataset was unzipped successfully
if (!dataDirectory.listFiles().exists(_.getName == "test-dataset")) {
throw new Exception("Test dataset was not unzipped successfully.")
}
val testFile = new File(dataDirectory, "test-dataset/datasource-properties.json")
if (!testFile.exists()) {
throw new Exception("Required file does not exist.")
}
val testFileSource = scala.io.Source.fromFile(testFile)
val testFileContent = try testFileSource.mkString
finally testFileSource.close()
if (testFileContent.isEmpty) {
throw new Exception("Required file is empty.")
}
}

}

0 comments on commit 152acca

Please sign in to comment.