-
Notifications
You must be signed in to change notification settings - Fork 2
/
test_anyall.py
52 lines (45 loc) · 1.16 KB
/
test_anyall.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
import pytest
from anyall import (contains_only_vowels,
contains_any_py_chars,
contains_digits)
@pytest.mark.parametrize("arg, expected", [
('aioue', True),
('EoUia', True),
('aaAiIee', True),
('AEIOU', True),
('aaeeouu', True),
('abcde', False),
('AE123', False),
('AiOuef', False),
])
def test_contains_only_vowels(arg, expected):
assert bool(contains_only_vowels(arg)) is expected
@pytest.mark.parametrize("arg, expected", [
('Python', True),
('pycharm', True),
('PYTHON', True),
('teaser', True),
('bob', True),
('julian', True),
('yes', True),
('no', True),
('america', False),
('B@b', False),
('Jules', False),
('agua', False),
('123', False),
('', False),
])
def test_contains_any_py_chars(arg, expected):
assert bool(contains_any_py_chars(arg)) is expected
@pytest.mark.parametrize("arg, expected", [
('yes1', True),
('123', True),
('hello2', True),
('up2date', True),
('yes', False),
('hello', False),
('', False),
])
def test_contains_digits(arg, expected):
assert bool(contains_digits(arg)) is expected