Skip to content

Commit 321fb86

Browse files
author
Xavier Grangier
committed
grangier#173 - authors extraction test case
1 parent 848acf8 commit 321fb86

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<html>
2+
<body>
3+
<p class="byline-dateline">
4+
<span class="byline" itemprop="author creator" itemscope="" itemtype="http://schema.org/Person" itemid="http://topics.nytimes.com/top/reference/timestopics/people/s/kevin_sack/index.html">By <a href="http://topics.nytimes.com/top/reference/timestopics/people/s/kevin_sack/index.html" rel="author" title="More Articles by KEVIN SACK"><span class="byline-author" data-byline-name="KEVIN SACK" itemprop="name" data-twitter-handle="ksacknyt">KEVIN SACK</span></a>, </span><span class="byline" itemprop="author creator" itemscope="" itemtype="http://schema.org/Person" itemid="http://topics.nytimes.com/top/reference/timestopics/people/f/sheri_fink/index.html"><a href="http://topics.nytimes.com/top/reference/timestopics/people/f/sheri_fink/index.html" rel="author" title="More Articles by SHERI FINK"><span class="byline-author" data-byline-name="SHERI FINK" itemprop="name">SHERI FINK</span></a>, </span><span class="byline" itemprop="author creator" itemscope="" itemtype="http://schema.org/Person" itemid="http://topics.nytimes.com/top/reference/timestopics/people/b/pam_belluck/index.html"><a href="http://topics.nytimes.com/top/reference/timestopics/people/b/pam_belluck/index.html" rel="author" title="More Articles by PAM BELLUCK"><span class="byline-author" data-byline-name="PAM BELLUCK" itemprop="name">PAM BELLUCK</span></a> and </span><span class="byline" itemprop="author creator" itemscope="" itemtype="http://schema.org/Person" itemid="http://topics.nytimes.com/top/reference/timestopics/people/n/adam_nossiter/index.html"><a href="http://topics.nytimes.com/top/reference/timestopics/people/n/adam_nossiter/index.html" rel="author" title="More Articles by ADAM NOSSITER"><span class="byline-author" data-byline-name="ADAM NOSSITER" itemprop="name">ADAM NOSSITER</span></a></span>
5+
</p>
6+
<div itemprop="articleBody">
7+
<p>
8+
TextNode 1 - The Scala supported IDE is one of the few pain points of developers who want to start using Scala in their Java project. On existing long term project developed by a team its hard to step in and introduce a new language that is not supported by the existing IDE. On way to go about it is to hid the fact that you use Scala from the Java world by using one way dependency injection. Still, if you wish to truly absorb Scala into your existing java environment then you'll soon introduced cross language dependencies.
9+
</p>
10+
</div>
11+
</body>
12+
</html>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"url": "http://exemple.com/tweet/",
3+
"expected": {
4+
"authors": [
5+
"KEVIN SACK",
6+
"ADAM NOSSITER",
7+
"PAM BELLUCK",
8+
"SHERI FINK"
9+
]
10+
}
11+
}

tests/extractors.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ def test_tweet(self):
448448
self.assertEqual(number_tweets, expected_number_tweets)
449449

450450

451+
class TestArticleAuthor(TestExtractionBase):
452+
453+
def test_author_schema(self):
454+
article = self.getArticle()
455+
fields = ['authors']
456+
self.runArticleAssertions(article=article, fields=fields)
457+
458+
451459
class TestArticleTags(TestExtractionBase):
452460

453461
def test_tags_kexp(self):

0 commit comments

Comments
 (0)