-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_yes_no_words.py
58 lines (42 loc) · 1.41 KB
/
test_yes_no_words.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
import pytest
import yes_no_words
def test_all():
assert len(yes_no_words.ALL)
def test_all_random():
word = yes_no_words.all_random()
assert len(word)
assert word in yes_no_words.ALL
assert "not" in yes_no_words.ALL
assert "yes" in yes_no_words.ALL
def test_no():
assert len(yes_no_words.NO)
assert "no" in yes_no_words.NO
assert "no" not in yes_no_words.YES
assert "false" in yes_no_words.NO
def test_no_random():
word = yes_no_words.no_random()
assert len(word)
assert "not" in yes_no_words.NO
assert "yes" not in yes_no_words.NO
assert word in yes_no_words.NO
assert word not in yes_no_words.YES
def test_yes():
assert len(yes_no_words.YES)
assert "yes" in yes_no_words.YES
assert "yes" not in yes_no_words.NO
assert "true" in yes_no_words.YES
def test_yes_random():
word = yes_no_words.yes_random()
assert len(word)
assert "yes" in yes_no_words.YES
assert "not" not in yes_no_words.YES
assert word in yes_no_words.YES
assert word not in yes_no_words.NO
@pytest.mark.parametrize("test_input", yes_no_words.NO)
def test_is_falsy(test_input):
assert yes_no_words.is_falsy(test_input)
assert not yes_no_words.is_truthy(test_input)
@pytest.mark.parametrize("test_input", yes_no_words.YES)
def test_is_truthy(test_input):
assert yes_no_words.is_truthy(test_input)
assert not yes_no_words.is_falsy(test_input)