diff options
author | Ellen Spertus <ellen.spertus@gmail.com> | 2018-07-28 15:41:43 -0700 |
---|---|---|
committer | Ellen Spertus <ellen.spertus@gmail.com> | 2018-07-28 15:41:43 -0700 |
commit | 70f3bc389f76d3fab76a67329c59891ae0f2804f (patch) | |
tree | 9cc6d70d68e8a4ed48f2cbe70578b1aa66ffc646 /scalding | |
parent | 5531eca73d9869ab2934ed5ec2c887829a335e57 (diff) | |
download | sandcrawler-70f3bc389f76d3fab76a67329c59891ae0f2804f.tar.gz sandcrawler-70f3bc389f76d3fab76a67329c59891ae0f2804f.zip |
Added tests (both pass) to try to understand crash when run on real datwa.
Diffstat (limited to 'scalding')
-rw-r--r-- | scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala b/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala index e6211a2..e4cab95 100644 --- a/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala +++ b/scalding/src/test/scala/sandcrawler/HBaseCrossrefScoreTest.scala @@ -126,6 +126,10 @@ class HBaseCrossrefScoreTest extends FlatSpec with Matchers { slug should contain ("hello there") } + it should "return None if given empty string" in { + HBaseCrossrefScore.titleToSlug("") shouldBe None + } + "grobidToSlug()" should "get the right slug for a grobid json string" in { val slug = HBaseCrossrefScore.grobidToSlug(GrobidStringWithTitle) slug should contain ("dummy example file") @@ -141,6 +145,11 @@ class HBaseCrossrefScoreTest extends FlatSpec with Matchers { slug shouldBe None } + it should "return None if given an empty json string" in { + val slug = HBaseCrossrefScore.grobidToSlug("") + slug shouldBe None + } + "crossrefToSlug()" should "get the right slug for a crossref json string" in { val slug = HBaseCrossrefScore.crossrefToSlug(CrossrefStringWithTitle) slug should contain ("sometitle") |