Skip to content

Commit

Permalink
#22: Added tests of currently working author detectors (#8).
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Nov 15, 2015
1 parent b62f784 commit e043bbb
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/analyzers/test_author_detector.py
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"

0 comments on commit e043bbb

Please sign in to comment.