-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_brazil_dream.py
74 lines (67 loc) · 1.96 KB
/
test_brazil_dream.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from cadurso import Cadurso
from tests.brazil.conftest import (
Character,
DreamPermission,
)
def test_sam_lowry_daydream(brazil_authz: Cadurso, sam_lowry: Character) -> None:
"""
Sam Lowry is a DREAMER and can daydream in his own mind.
"""
assert brazil_authz.is_allowed(sam_lowry, DreamPermission.DAYDREAM, sam_lowry)
def test_others_cannot_daydream_in_sam(
brazil_authz: Cadurso,
sam_lowry: Character,
jill_layton: Character,
harry_tuttle: Character,
mr_kurtzmann: Character,
chief_minister: Character,
jack_lint: Character,
spoor: Character,
dowser: Character,
) -> None:
"""
None of these other characters have the right to daydream in Sam's mind,
because either they are not Sam, or they lack the DREAMER role.
"""
for not_sam_character in [
jill_layton,
harry_tuttle,
mr_kurtzmann,
chief_minister,
jack_lint,
spoor,
dowser,
]:
assert not brazil_authz.is_allowed(
not_sam_character, DreamPermission.DAYDREAM, sam_lowry
)
# They cannot daydream in their own minds either, as only Sam is a DREAMER in this universe
assert not brazil_authz.is_allowed(
not_sam_character, DreamPermission.DAYDREAM, not_sam_character
)
def test_sam_cannot_daydream_in_others(
brazil_authz: Cadurso,
sam_lowry: Character,
jill_layton: Character,
harry_tuttle: Character,
mr_kurtzmann: Character,
chief_minister: Character,
jack_lint: Character,
spoor: Character,
dowser: Character,
) -> None:
"""
Sam Lowry cannot daydream in the minds of others, as he is not a psychic.
"""
for someone_else in [
jill_layton,
harry_tuttle,
mr_kurtzmann,
chief_minister,
jack_lint,
spoor,
dowser,
]:
assert not brazil_authz.is_allowed(
sam_lowry, DreamPermission.DAYDREAM, someone_else
)