-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
b62f784
commit e043bbb
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#! /usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Interpreter version: python 2.7 | ||
# | ||
# Imports ===================================================================== | ||
from wa_kat.analyzers.author_detector import get_author_tags | ||
|
||
|
||
# Variables =================================================================== | ||
TEST_TEMPLATE = """ | ||
<HTML> | ||
<head> | ||
<title>HTML title</title> | ||
<meta name = "dc.creator" | ||
content = "mr. Dublin Core"> | ||
<meta name = "author" | ||
content = "mr. Meta Author"> | ||
</head> | ||
<body> | ||
Somecontent. | ||
</body> | ||
</HTML> | ||
""" | ||
|
||
|
||
# Tests ======================================================================= | ||
def test_get_author_tags(): | ||
authors = get_author_tags(TEST_TEMPLATE) | ||
|
||
assert authors[0] == "mr. Meta Author" | ||
assert authors[0].source == "HTML" | ||
|
||
assert authors[1] == "mr. Dublin Core" | ||
assert authors[1].source == "DC" |