示例#1
0
    def test_availability(self):

        sample_availability = {
            'week1': 1,
            'week2': 0,
            'week3': 1,
            'week4': 0,
            'week5': 0
        }
        vol = Volunteer(volunteer_id='v001')
        vol.set_availability('tuesday', sample_availability)
        self.assertEqual(vol.get_availability('tuesday'), sample_availability,
                         "availability is set and retrieved correctly")
def make_volunteer(volunteer_info):

    volunteer = Volunteer(volunteer_info[0])

    tues_av = {
        "week1": volunteer_info[1],
        "week2": volunteer_info[3],
        "week3": volunteer_info[5],
        "week4": volunteer_info[7],
        "week5": volunteer_info[9]
    }
    thur_av = {
        "week1": volunteer_info[2],
        "week2": volunteer_info[4],
        "week3": volunteer_info[6],
        "week4": volunteer_info[8],
        "week5": volunteer_info[10]
    }

    volunteer.set_availability('tuesday', tues_av)
    volunteer.set_availability('thursday', thur_av)

    return volunteer