aboutsummaryrefslogtreecommitdiffstats
path: root/scalding/src/test/scala
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2018-08-21 11:14:22 -0700
committerBryan Newbold <bnewbold@archive.org>2018-08-21 11:14:22 -0700
commit96f45740599a9d9ed06cf22eba8cd0a0e0927a42 (patch)
treef9064ccd26c02a813b128e36827418a1f5840ba3 /scalding/src/test/scala
parent34fa226b27a8597ae1da788a41be2880b1cbf4fc (diff)
parentf73796fe22d96e1d5ad559ffcb8dfe8fc10b3c20 (diff)
downloadsandcrawler-96f45740599a9d9ed06cf22eba8cd0a0e0927a42.tar.gz
sandcrawler-96f45740599a9d9ed06cf22eba8cd0a0e0927a42.zip
Merge branch 'strings'
Resolved conflicts in: scalding/src/main/scala/sandcrawler/ScorableFeatures.scala
Diffstat (limited to 'scalding/src/test/scala')
-rw-r--r--scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala21
-rw-r--r--scalding/src/test/scala/sandcrawler/ScoreJobTest.scala1
2 files changed, 22 insertions, 0 deletions
diff --git a/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala b/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala
index 8a293fe..5a22ef8 100644
--- a/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala
+++ b/scalding/src/test/scala/sandcrawler/ScorableFeaturesTest.scala
@@ -1,9 +1,30 @@
package sandcrawler
+import java.io.InputStream
+
+import scala.io.Source
+
import org.scalatest._
// scalastyle:off null
class ScorableFeaturesTest extends FlatSpec with Matchers {
+
+ // TODO: Remove this when we're convinced that our file-reading code
+ // works. (I'm already convinced. --Ellen)
+ "read slugs" should "work" in {
+ val SlugBlacklist = Set( "abbreviations", "abstract", "acknowledgements",
+ "article", "authorreply", "authorsreply", "bookreview", "bookreviews",
+ "casereport", "commentary", "commentaryon", "commenton", "commentto",
+ "contents", "correspondence", "dedication", "editorialadvisoryboard",
+ "focus", "hypothesis", "inbrief", "introduction", "introductiontotheissue",
+ "lettertotheeditor", "listofabbreviations", "note", "overview", "preface",
+ "references", "results", "review", "reviewarticle", "summary", "title",
+ "name")
+
+ ScorableFeatures.SlugBlacklist.size shouldBe SlugBlacklist.size
+ for (s <- ScorableFeatures.SlugBlacklist) SlugBlacklist should contain (s)
+ }
+
private def titleToSlug(s : String) : String = {
ScorableFeatures.create(title = s).toSlug
}
diff --git a/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala b/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala
index 55ae614..00e4659 100644
--- a/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala
+++ b/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala
@@ -163,6 +163,7 @@ class ScoreJobTest extends FlatSpec with Matchers {
// scalastyle:off null
// Add example of lines without GROBID data
+ // scalastyle:off null
val SampleData = SampleDataHead :+ new Tuple(
new ImmutableBytesWritable(Bytes.toBytes("sha1:35985C3YNNEGH5WAG5ZAA88888888888")), null, null)
// scalastyle:on null