Tests for Task 9: Vaccinate a person

This page describes the tests for Task 9. For each task, we provide a short description of the test, information about how to recreate the test in ipython3, and the expected result.

To run the tasks for Task 9, run the following command at the Linux command-line:

$ py.test -xvk vaccinate_person

Test 0

Purpose: Infected person w/ zero days in that state

To run this test in ipython3 :

vaccinate_person(('I', 0, True))

Expected result: ['I', 0]

Test 1

Purpose: Infected person w/ non-zero number of days in that state

To run this test in ipython3 :

vaccinate_person(('I', 10, True))

Expected result: ['I', 10]

Test 2

Purpose: Infected person w/ non-zero number of days in that state

To run this test in ipython3 :

vaccinate_person(('I', 5, False))

Expected result: ['I', 5]

Test 3

Purpose: Recovered person w/ zero days in that state

To run this test in ipython3 :

vaccinate_person(('R', 0, True))

Expected result: ['R', 0]

Test 4

Purpose: Recovered person w/ non-zero number of days in that state

To run this test in ipython3 :

vaccinate_person(('R', 10, True))

Expected result: ['R', 10]

Test 5

Purpose: Recovered person w/ non-zero number of days in that state

To run this test in ipython3 :

vaccinate_person(('R', 5, False))

Expected result: ['R', 5]

Test 6

Purpose: Susceptible person willing to be vaccinated

To run this test in ipython3 :

vaccinate_person(('S', 0, True))

Expected result: ['V', 0]

Test 7

Purpose: Susceptible person willing to be vaccinated

To run this test in ipython3 :

vaccinate_person(('S', 10, True))

Expected result: ['V', 0]

Test 8

Purpose: Susceptible person not willing to be vaccinated

To run this test in ipython3 :

vaccinate_person(('S', 10, False))

Expected result: ['S', 10]