forked from hedyorg/hedy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_python_prefixes.py
25 lines (21 loc) · 1.18 KB
/
test_python_prefixes.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
import pytest
from prefixes.normal import convert_numerals
convert_numerals_test_data = [
('Latin', 1234567890, 1234567890),
('Latin', '١٢٣٤٥٦٧٨٩٠', 1234567890),
('Arabic', 1234567890, '١٢٣٤٥٦٧٨٩٠'),
('Latin', 1234567890.0987654321, 1234567890.0987654321),
('Latin', '١٢٣٤٥٦٧٨٩٠.٠٩٨٧٦٥٤', 1234567890.0987654321),
('Arabic', 1234567890.0987654321, '١٢٣٤٥٦٧٨٩٠.٠٩٨٧٦٥٤'),
('Latin', -1234567890, -1234567890),
('Latin', '-١٢٣٤٥٦٧٨٩٠', -1234567890),
('Arabic', -1234567890, '-١٢٣٤٥٦٧٨٩٠'),
('Latin', -1234567890.0987654321, -1234567890.0987654321),
('Latin', '-١٢٣٤٥٦٧٨٩٠.٠٩٨٧٦٥٤', -1234567890.0987654321),
('Arabic', -1234567890.0987654321, '-١٢٣٤٥٦٧٨٩٠.٠٩٨٧٦٥٤'),
('Latin', '1 Thing, this is 1 arbitrary string', '1 Thing, this is 1 arbitrary string'),
('Arabic', '1 Thing, this is 1 arbitrary string', '1 Thing, this is 1 arbitrary string'),
]
@pytest.mark.parametrize("alphabet, number, expected", convert_numerals_test_data)
def test_convert_numerals(alphabet, number, expected):
assert convert_numerals(alphabet, number) == expected