From 4c1a2dd69bbf221f99daee5778d9b70b179d90af Mon Sep 17 00:00:00 2001 From: Chris Lindholm Date: Sun, 15 Mar 2020 12:40:38 -0600 Subject: [PATCH] Fix BinaryAdapter test The AdaptedDataset trait changed in LaTiS 3. See #11. --- src/test/scala/latis/input/HapiBinaryAdapterSpec.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/scala/latis/input/HapiBinaryAdapterSpec.scala b/src/test/scala/latis/input/HapiBinaryAdapterSpec.scala index b1c24a0..9db4c19 100644 --- a/src/test/scala/latis/input/HapiBinaryAdapterSpec.scala +++ b/src/test/scala/latis/input/HapiBinaryAdapterSpec.scala @@ -11,9 +11,9 @@ 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¶meters=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( @@ -21,10 +21,13 @@ class HapiBinaryAdapterSpec extends FlatSpec { 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 {