Skip to content

Commit

Permalink
Added tests of place detector. Fixed #5.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Jul 19, 2015
1 parent 92c6735 commit 75fc617
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/analyzers/test_language_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
# Interpreter version: python 2.7
#
# Imports =====================================================================
import pytest

from wa_kat.analyzers.language_detector import get_lang_tags


Expand Down
34 changes: 34 additions & 0 deletions tests/analyzers/test_place_detector.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from wa_kat.analyzers.place_detector import get_place_tags


# Variables ===================================================================
TEST_TEMPLATE = """
<HTML>
<head>
<title>HTML title</title>
<meta name = "geo.placename"
content = "Praha">
</head>
<body>
Somecontent.
</body>
</HTML>
"""


# Tests =======================================================================
def test_get_place_tags():
place_tags = get_place_tags(TEST_TEMPLATE, "nkp.cz")

assert place_tags[0] == "Praha"
assert place_tags[0].source == "HTML"

assert place_tags[1] == "Narodni knihovna Ceske republiky, Klementinum 190, Praha 1, 110 00, The Czech Republic"
assert place_tags[1].source == "Whois"

0 comments on commit 75fc617

Please sign in to comment.