-
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.
Added tests of place detector. Fixed #5.
- Loading branch information
1 parent
92c6735
commit 75fc617
Showing
2 changed files
with
34 additions
and
2 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
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,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" |