Skip to content

Commit 3603c14

Browse files
committed
Add tests for author()
1 parent 82ad64f commit 3603c14

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_article_only.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,13 @@ def test_utf8_kanji(self):
124124
sample = load_sample("utf-8-kanji.sample.html")
125125
doc = Document(sample)
126126
res = doc.summary()
127+
128+
def test_author_present(self):
129+
sample = load_sample("the-hurricane-rubin-carter-denzel-washington.html")
130+
doc = Document(sample)
131+
assert 'Alex von Tunzelmann' == doc.author()
132+
133+
def test_author_absent(self):
134+
sample = load_sample("si-game.sample.html")
135+
doc = Document(sample)
136+
assert '[no-author]' == doc.author()

0 commit comments

Comments
 (0)