Skip to content

Commit

Permalink
Fix BinaryAdapter test
Browse files Browse the repository at this point in the history
The AdaptedDataset trait changed in LaTiS 3.

See #11.
  • Loading branch information
lindholc committed Mar 16, 2020
1 parent c707395 commit 4c1a2dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/test/scala/latis/input/HapiBinaryAdapterSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ import org.scalatest.Matchers._

class HapiBinaryAdapterSpec extends FlatSpec {

val uri: URI = FileUtils.resolvePath("data/hapi_binary_data").get.toUri

val reader = new AdaptedDatasetReader {
//def uri: URI = new URI("https://cdaweb.gsfc.nasa.gov/hapi/data?id=AC_H0_MFI&time.min=2019-01-01&time.max=2019-01-02&parameters=Magnitude,dBrms&format=binary")
def uri: URI = FileUtils.resolvePath("data/hapi_binary_data").get.toUri
def model: DataType = Function(
Scalar(Metadata("id" -> "Time", "type" -> "string", "length" -> "24")),
Tuple(
Scalar(Metadata("id" -> "Magnitude", "type" -> "double")),
Scalar(Metadata("id" -> "dBrms", "type" -> "double"))
)
)

def metadata = Metadata("hapi_binary")

def adapter = new BinaryAdapter(model)
}

val ds = reader.getDataset
val ds = reader.read(uri)

"The first sample in the HAPI Binary dataset" should "contain the correct values" in {
StreamUtils.unsafeHead(ds.samples) match {
Expand Down

0 comments on commit 4c1a2dd

Please sign in to comment.