Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from e11_alphabetize_names import alphabetize_names, PEOPLE 

2 

3 

4def test_empty(): 

5 assert alphabetize_names([]) == [] 

6 

7 

8def test_with_people(): 

9 assert PEOPLE[0]['last'] == 'Lerner' 

10 assert PEOPLE[1]['last'] == 'Trump' 

11 assert PEOPLE[2]['last'] == 'Putin' 

12 

13 output = alphabetize_names(PEOPLE) 

14 assert output[0]['last'] == 'Lerner' 

15 assert output[1]['last'] == 'Putin' 

16 assert output[2]['last'] == 'Trump'