-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_title_article.py
83 lines (62 loc) · 1.92 KB
/
test_title_article.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env LANG=en_UK.UTF-8 /usr/local/bin/python3
import title_article
def test_en_one():
data = title_article.splitter("The Lighthouse", "en")
title = data[0]
title_art = data[1]
assert title == "Lighthouse"
assert title_art == "The"
def test_en_two():
data = title_article.splitter("the LIGHTHOUSE", "eN")
title = data[0]
title_art = data[1]
assert title == "Lighthouse"
assert title_art == "The"
def test_en_three():
data = title_article.splitter("Lighthouse, The", "en")
title = data[0]
title_art = data[1]
assert title == "Lighthouse, The"
assert title_art == ""
def test_fr():
data = title_article.splitter("L'atlante", "fr")
title = data[0]
title_art = data[1]
assert title == "Atlante"
assert title_art == "L'"
def test_ar():
data = title_article.splitter("EL-KALAA", "ar")
title = data[0]
title_art = data[1]
assert title == "Kalaa"
assert title_art == "El"
def test_iso_error():
data = title_article.splitter("The Lighthouse", "es")
title = data[0]
title_art = data[1]
assert title == "The Lighthouse"
assert title_art == ""
def test_jp():
data = title_article.splitter("カタカナ", "jp")
title = data[0]
title_art = data[1]
assert title == "カタカナ"
assert title_art == ""
def test_de():
data = title_article.splitter("Die berühmte Frau", "de")
title = data[0]
title_art = data[1]
assert title == "Berühmte Frau"
assert title_art == "Die"
def test_mess_one():
data = title_article.splitter("kgroleth9jfgkgroleth9jfg", "93")
title = data[0]
title_art = data[1]
assert title == "kgroleth9jfgkgroleth9jfg"
assert title_art == ""
def test_mess_two():
data = title_article.splitter("k2134&*%78237489(*7534275892", "=_")
title = data[0]
title_art = data[1]
assert title == "k2134&*%78237489(*7534275892"
assert title_art == ""