Code review comment for lp:~carla-sella/ubuntu-calendar-app/calendar-app

Revision history for this message
Olivier Tilloy (osomon) wrote :

172 + save_button = self.main_window.get_event_save_button()
173 + self.assertThat(lambda: save_button, Eventually(NotEquals(None)))

179 + title_label = self.main_window.get_title_label(eventTitle)
180 + self.assertThat(lambda: title_label, Eventually(NotEquals(None)))

This is not doing what you think it does: because 'save_button' and 'title_label' are assigned before defining the lambda function, they contain static values, so the lambda is useless. For it to be useful, you need to use it like that:

    lambda: self.main_window.get_event_save_button()
    lambda: self.main_window.get_title_label(eventTitle)

And since you’re comparing to None, instead of using Equals (or NotEquals), you should use the identity matcher, Is, like that:

    self.assertThat(…, Eventually(Not(Is(None))))

review: Needs Fixing

« Back to merge proposal