Skip to content

Commit 4e5698a

Browse files
committed
Additional tests for DataFrame rendering truncation.
1 parent 66e135a commit 4e5698a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

core/src/test/scala/org/locationtech/rasterframes/ExtensionMethodSpec.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,22 @@ class ExtensionMethodSpec extends TestEnvironment with TestData with SubdivideSu
119119
md.count(_ == '|') shouldBe >=(3 * 5)
120120
md.count(_ == '\n') should be >= 6
121121

122-
val md2 = rf.withColumn("long_string", lit("p" * 42)).toMarkdown(truncate=true)
122+
val md2 = rf.withColumn("long_string", lit("p" * 42)).toMarkdown(truncate=true, renderTiles = false)
123123
md2 should include ("...")
124+
125+
val md3 = rf.toMarkdown(truncate=true, renderTiles = false)
126+
md3 shouldNot include("<img")
124127
}
125128

126129
it("should render HTML") {
127-
val html = rf.toHTML()
130+
val html = rf.toHTML(renderTiles = false)
128131
noException shouldBe thrownBy {
129132
XhtmlParser(scala.io.Source.fromString(html))
130133
}
131-
println(html)
134+
val html2 = rf.toHTML(renderTiles = true)
135+
noException shouldBe thrownBy {
136+
XhtmlParser(scala.io.Source.fromString(html2))
137+
}
132138
}
133139
}
134140
}

core/src/test/scala/org/locationtech/rasterframes/RasterFunctionsSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import java.io.ByteArrayInputStream
2525

2626
import geotrellis.proj4.LatLng
2727
import geotrellis.raster
28-
import geotrellis.raster.testkit.RasterMatchers
2928
import geotrellis.raster._
30-
import geotrellis.raster.render.{ColorRamps, Png}
29+
import geotrellis.raster.render.ColorRamps
30+
import geotrellis.raster.testkit.RasterMatchers
3131
import geotrellis.vector.Extent
3232
import javax.imageio.ImageIO
3333
import org.apache.spark.sql.Encoders

0 commit comments

Comments
 (0)