예제 #1
0
    def test_lunch_and_network_exists_in_track(self):
        track = Track(datetime.now())
        talk1 = Talk("Fedoka", 3 * 60)
        talk2 = Talk("Tutu de Feijão", 4 * 60)

        track.schedule_talk(talk1)
        track.schedule_talk(talk2)

        timeline_titles = [talk.title for talk in track.get_timeline()]

        assert 'Network' in timeline_titles
        assert 'Lunch' in timeline_titles
예제 #2
0
    def test_talk_is_added_correctly(self):
        track = Track(datetime.now())
        talk = Talk("qualquer bosta denovo", 60)
        track.schedule_talk(talk)

        scheduled = track.get_timeline()[0]

        assert scheduled.title == talk.title
        assert scheduled.duration == talk.duration
        assert scheduled.date.hour == 9
        assert scheduled.date.minute == 0
        assert scheduled.date.second == 0
        assert scheduled.date.microsecond == 0
예제 #3
0
    def test_that_the_talk_date_is_based_on_previous_talk(self):
        track = Track(datetime.now())
        talk = Talk("qualquer bosta denovo", 30)
        track.schedule_talk(talk)

        talk2 = Talk("bostona veia", 30)
        track.schedule_talk(talk2)
        scheduled = track.get_timeline()[1]

        assert scheduled.title == talk2.title
        assert scheduled.duration == talk2.duration
        assert scheduled.date.hour == 9
        assert scheduled.date.minute == 30
        assert scheduled.date.second == 0
        assert scheduled.date.microsecond == 0
예제 #4
0
    def test_that_i_reeschedule_a_talk_when_is_the_lunch_hour(self):
        track = Track(datetime.now())
        talk = Talk("Talk 1", 3 * 60)
        track.schedule_talk(talk)

        talk2 = Talk("Talk on the lunch hour", 30)

        track.schedule_talk(talk2)
        scheduled = track.get_timeline()[2]

        assert scheduled.title == talk2.title
        assert scheduled.duration == talk2.duration
        assert scheduled.date.hour == 13
        assert scheduled.date.minute == 0
        assert scheduled.date.second == 0
        assert scheduled.date.microsecond == 0
예제 #5
0
    def test_talks_is_ordered_by_hour(self):
        date = datetime(2018, 1, 1)
        track = Track(date)
        talk1 = Talk("Fedoka", 3 * 60)
        talk2 = Talk("Tutu de Feijão", 4 * 60)

        track.schedule_talk(talk1)
        track.schedule_talk(talk2)

        timeline = track.get_timeline()

        assert timeline[0].get_title() == 'Fedoka'
        assert timeline[0].get_date() == datetime(2018, 1, 1, 9)
        assert timeline[1].get_title() == 'Lunch'
        assert timeline[1].get_date() == datetime(2018, 1, 1, 12)
        assert timeline[2].get_title() == 'Tutu de Feijão'
        assert timeline[2].get_date() == datetime(2018, 1, 1, 13)
        assert timeline[3].get_title() == 'Network'
        assert timeline[3].get_date() == datetime(2018, 1, 1, 17)
예제 #6
0
    def test_when_a_talk_is_added_in_an_empty_track(self):
        track = Track(datetime.now())
        talk = Talk("qualquer bosta", 60)
        track.schedule_talk(talk)

        assert len(track.get_timeline()) == 3