-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathplayer_stub.py
More file actions
80 lines (73 loc) · 1.97 KB
/
player_stub.py
File metadata and controls
80 lines (73 loc) · 1.97 KB
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
75
76
77
78
79
80
class Player:
"""
Test stub representing a Player.
"""
def __init__(
self,
id=None,
first_name=None,
middle_name=None,
last_name=None,
date_of_birth=None,
squad_number=None,
position=None,
abbr_position=None,
team=None,
league=None,
starting11=None,
):
self.id = id
self.first_name = first_name
self.middle_name = middle_name
self.last_name = last_name
self.date_of_birth = date_of_birth
self.squad_number = squad_number
self.position = position
self.abbr_position = abbr_position
self.team = team
self.league = league
self.starting11 = starting11
def existing_player():
"""
Creates a test stub for an existing Player.
"""
return Player(
id="01772c59-43f0-5d85-b913-c78e4e281452",
first_name="Damián",
middle_name="Emiliano",
last_name="Martínez",
date_of_birth="1992-09-02T00:00:00.000Z",
squad_number=23,
position="Goalkeeper",
abbr_position="GK",
team="Aston Villa FC",
league="Premier League",
starting11=1,
)
def nonexistent_player():
"""
Creates a test stub for a nonexistent (new) Player.
No id is provided; the server generates a UUID on creation.
"""
return Player(
first_name="Giovani",
last_name="Lo Celso",
date_of_birth="1996-07-09T00:00:00.000Z",
squad_number=27,
position="Central Midfield",
abbr_position="CM",
team="Real Betis Balompié",
league="La Liga",
starting11=False,
)
def unknown_player():
"""
Creates a test stub for an unknown Player (valid UUID format, not in database).
"""
return Player(
id="00000000-0000-0000-0000-000000000000",
first_name="John",
last_name="Doe",
squad_number=999,
position="Lipsum",
)