forked from bojohan/rovarsprak
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_swede.py
38 lines (26 loc) · 1.04 KB
/
test_swede.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
# -*- coding: utf-8 -*-
import pytest
from rovare import swede
def test_translate_one():
"""we should translate hohelollolo to hello"""
assert swede('hohelollolo') == 'hello'
def test_translate_two():
"""we should handle whitespaces"""
assert swede('cocododinongog isos fofunon') == 'coding is fun'
def test_translate_three():
"""we should handle unicode correct"""
assert swede('dodetot äror lologogisoskoktot') == 'det är logiskt'
def test_number_is_string():
"""Number should be converted to string"""
assert swede(8888) == '8888'
@pytest.mark.skip(reason='str is not a valid rovare text')
def test_everything_is_a_string():
"""even functions should be converted to string"""
assert swede("str") == "<type 'str'>"
def test_do_not_pass_empty_values():
"""calling function without argument should raise TypeError"""
with pytest.raises(TypeError):
swede()
@pytest.mark.skip(reason='hardproblem')
def test_extra():
assert swede('dodanonsosa momedod sosakoksosaror') == 'dansa med saxar'