-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_translate.py
executable file
·44 lines (35 loc) · 1.48 KB
/
test_translate.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
#!/usr/bin/python
"""Tests for the whats_on_translate file"""
import whats_on_translate
#------------------------------------------------------------------------
OVERRIDE_ARTIST_EQ = [
('Who', 'The Who'),
('dude', None),
]
OVERRIDE_ARTIST_NE = [
('dude', 'fail'),
('Who', None),
]
def test_override_artist():
"""Tests the override_artist function"""
for override in OVERRIDE_ARTIST_EQ:
print("Checking", override[0])
assert override[1] == whats_on_translate.override_artist(override[0])
for override in OVERRIDE_ARTIST_NE:
print("Checking", override[0])
assert override[1] != whats_on_translate.override_artist(override[0])
#------------------------------------------------------------------------
OVERRIDE_SONG_EQ = [
(('deadmau5', "Ghosts 'N Stuff"), "Ghosts N Stuff"),
(('foo', 'fail'), None),
]
OVERRIDE_SONG_NE = [
(('foo', "Ghosts 'N Stuff"), "Ghosts N Stuff"),
(('deadmau5', "'N Stuff"), "Ghosts N Stuff"),
]
def test_override_song():
"""Tests the override_song function"""
for override in OVERRIDE_SONG_EQ:
assert override[1] == whats_on_translate.override_song(override[0])
for override in OVERRIDE_SONG_NE:
assert override[1] != whats_on_translate.override_song(override[0])