def block_events(block_begin_time, block_end_time): events = [ CustomEvent( title='Boost Maintainability', location=Location.R0, begin_time=block_begin_time, end_time=block_end_time, ), CustomEvent( title='We Made the PyCon TW 2016 Website', location=Location.R1, begin_time=block_begin_time, end_time=block_end_time, ), CustomEvent( title='Deep Learning and Application in Python', location=Location.R2, begin_time=block_begin_time, end_time=block_end_time, ), CustomEvent( title='Free-market sub-orbital tattoo', location=Location.R3, begin_time=block_begin_time, end_time=block_end_time, ), ] return events
def test_render_columned_period(parser, utils, make_time, time_count): times = [make_time(h) for h in range(time_count)] rendered, _ = renderers.render_columned_period(times, [ CustomEvent( title='M<3', location=Location.ALL, begin_time=begin_time, end_time=end_time, ) for begin_time, end_time in zip(times[:-1], times[1:]) ]) assert utils.is_safe(rendered) expected = { 2: ('<div class="columned time-table__time time-table__time--row-span ' 'time-table__time--hsmall">' ' <div class="time__cell">0:00<br>|<br>1:00</div>' '</div>'), 3: ('<div class="columned time-table__time time-table__time--row-span ' 'time-table__time--h2">' ' <div class="time__cell">0:00<br>|<br>1:00</div>' ' <div class="time__cell">1:00<br>|<br>2:00</div>' '</div>'), 4: ('<div class="columned time-table__time time-table__time--row-span ' 'time-table__time--h3">' ' <div class="time__cell">0:00<br>|<br>1:00</div>' ' <div class="time__cell">1:00<br>|<br>2:00</div>' ' <div class="time__cell">2:00<br>|<br>3:00</div>' '</div>'), }[time_count] assert parser.arrange(rendered) == parser.arrange(expected)
def partial_belt_block_events( partial_belt_block_begin_time, partial_belt_block_end_time): events = [ CustomEvent( title='Refreshment', location=Location.R012, begin_time=partial_belt_block_begin_time, end_time=partial_belt_block_end_time, ), CustomEvent( title='Free-market sub-orbital tattoo', location=Location.R3, begin_time=partial_belt_block_begin_time, end_time=partial_belt_block_end_time, ), ] return events
def partial_belt_events(partial_belt_begin_time, partial_belt_end_time): event = CustomEvent( title='Refreshment', location=Location.R012, begin_time=partial_belt_begin_time, end_time=partial_belt_end_time, ) return [event]
def mismatch_block_events(mismatch_block_begin_time, mismatch_block_mid_time, mismatch_block_end_time): events = [ CustomEvent( title='Refreshment', location=Location.R012, begin_time=mismatch_block_begin_time, end_time=mismatch_block_end_time, ), CustomEvent( title='Free-market sub-orbital tattoo', location=Location.R3, begin_time=mismatch_block_begin_time, end_time=mismatch_block_mid_time, ), ] return events
def partial_block_events(partial_block_begin_time, partial_block_end_time): events = [ CustomEvent( title='Boost Maintainability', location=Location.R0, begin_time=partial_block_begin_time, end_time=partial_block_end_time, ), CustomEvent( title='We Made the PyCon TW 2016 Website', location=Location.R1, begin_time=partial_block_begin_time, end_time=partial_block_end_time, ), CustomEvent( title='Deep Learning and Application in Python', location=Location.R2, begin_time=partial_block_begin_time, end_time=partial_block_end_time, ), ] return events