-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathplayer_stub.py
More file actions
81 lines (74 loc) · 1.85 KB
/
player_stub.py
File metadata and controls
81 lines (74 loc) · 1.85 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
81
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=1,
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.
"""
return Player(
id=24,
first_name="Thiago",
middle_name="Ezequiel",
last_name="Almada",
date_of_birth="2001-04-26T00:00:00.000Z",
squad_number=16,
position="Attacking Midfield",
abbr_position="AM",
team="Atlanta United FC",
league="Major League Soccer",
starting11=0,
)
def unknown_player():
"""
Creates a test stub for an unknown Player.
"""
return Player(
id=999,
first_name="John",
last_name="Doe",
squad_number="999",
position="Lipsum",
)