Skip to content

Commit 0c4f332

Browse files
committed
Refine README and fix exercise date related tests
1 parent c36ffd0 commit 0c4f332

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ up with `docker-compose up` you will be able to hit the test `GET /` endpoint at
142142
__3.__ Testing
143143

144144
Unit tests are encouraged but not required; we'll understand if you spend your
145-
time on the solution rather than the tests. (Especially because we provide a
146-
test harness, see below.)
145+
time on the solution rather than the tests. Especially because we provide a
146+
[test harness](exercise), see below. It is likely a good idea to use the test harness
147+
to test your code early and as you go, maybe try approaching the problems in parts;
148+
create a student, get a student, find students.
147149

148150
## Checking your work
149151

@@ -196,9 +198,11 @@ OK
196198

197199
__1.__ Timeframe
198200

199-
You should take a max of three hours to complete this exercise. We want to be
201+
You should take a maximum of three hours to complete this exercise. We want to be
200202
both respectful of your time and fair to other candidates who might not have
201-
a whole weekend to work on it.
203+
a whole weekend to work on it. It is a complex task, we are looking to see
204+
how you approach the problems. Try to pass as many of the [exercise](exercise)
205+
tests as you can, and be able to talk about the tests you didn't get to.
202206

203207
__2.__ Git
204208

exercise/check.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -175,20 +175,22 @@ def test_multiple_match_any_name(self):
175175
self.assert_first_names(doc, ['Jamie', 'Jimbo'])
176176

177177
def test_no_match_started_after(self):
178+
now = datetime.now()
178179
doc = self.assert_get_in(
179180
[200], 'With no match checking started_after',
180-
query_args={'started_after': '2019-10-31'}
181+
query_args={'started_after': str(now.year+10)+'-10-31'}
181182
).json()
182183
self.assertEqual(doc['students'], [])
183184

184185
def test_multiple_matches_started_after(self):
185-
self.create(first_name="Chuck", started_at="2016-11-09")
186-
self.create(first_name="Carol", started_at="2019-01-13")
187-
self.create(first_name="Cindy", started_at="2018-04-08")
188-
self.create(first_name="Carl", started_at="2017-09-12")
186+
now = datetime.now()
187+
self.create(first_name="Chuck", started_at=str(now.year-2)+"-11-09")
188+
self.create(first_name="Carol", started_at=str(now.year+3)+"-01-13")
189+
self.create(first_name="Cindy", started_at=str(now.year+2)+"-04-08")
190+
self.create(first_name="Carl", started_at=str(now.year-1)+"-09-12")
189191
doc = self.assert_get_in(
190192
[200], 'With multiple matches checking started_after',
191-
query_args={'started_after': '2018-03-31'}
193+
query_args={'started_after': str(now.year+1)+'-03-31'}
192194
).json()
193195
self.assert_first_names(doc, ['Carol', 'Cindy'])
194196

0 commit comments

Comments
 (0)