Spaces:
Runtime error
Runtime error
Jessica Walkenhorst
commited on
Commit
•
99d6492
1
Parent(s):
6295a87
Add test and code
Browse files
src/maorganizer/datawrangling.py
CHANGED
@@ -60,6 +60,10 @@ class Attendancelist:
|
|
60 |
|
61 |
return Attendancelist({Person(name) for name in df[cname]})
|
62 |
|
|
|
|
|
|
|
|
|
63 |
def to_df(self):
|
64 |
return pd.DataFrame(
|
65 |
[
|
|
|
60 |
|
61 |
return Attendancelist({Person(name) for name in df[cname]})
|
62 |
|
63 |
+
@property
|
64 |
+
def n_attendees(self):
|
65 |
+
return len(self.participants)
|
66 |
+
|
67 |
def to_df(self):
|
68 |
return pd.DataFrame(
|
69 |
[
|
tests/test_attendancelist.py
CHANGED
@@ -32,3 +32,10 @@ def test_attendance_list_updates_correctly():
|
|
32 |
}
|
33 |
)
|
34 |
) == Attendancelist(participants={Person("lord crawfish")})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
)
|
34 |
) == Attendancelist(participants={Person("lord crawfish")})
|
35 |
+
|
36 |
+
|
37 |
+
def test_attendancelist_has_correct_n_attendees():
|
38 |
+
assert (
|
39 |
+
Attendancelist({Person("zaphod beeblebrox"), Person("ford prefix")}).n_attendees
|
40 |
+
== 2
|
41 |
+
)
|