Exemple #1
0
 def test_can_move_period_without_zooming(self):
     a = Animation(self.timeline,
             py_period("1 Jan 2010", "2 Jan 2010"),
             2,
             py_period("3 Jan 2010", "4 Jan 2010"))
     a.change_current_period(1)
     self.assertEquals(a.current_period, py_period("2 Jan 2010", "3 Jan 2010"))
 def when_navigating(self, fn, start, end, week_starts_on_monday=True):
     def navigation_fn(fn):
         self.new_period = fn(self.time_period)
     self.time_period = py_period(start, end)
     main_frame = Mock(MainFrame)
     main_frame.week_starts_on_monday.return_value = week_starts_on_monday
     fn(main_frame, self.time_period, navigation_fn)
    def when_navigating(self, fn, start, end, week_starts_on_monday=True):
        def navigation_fn(fn):
            self.new_period = fn(self.time_period)

        self.time_period = py_period(start, end)
        main_frame = Mock(MainFrame)
        main_frame.week_starts_on_monday.return_value = week_starts_on_monday
        fn(main_frame, self.time_period, navigation_fn)
 def then_period_becomes(self, start, end):
     self.assertEquals(py_period(start, end), self.new_period)
 def assert_navigation_raises(self, exception, fn, start, end):
     def navigation_fn(fn):
         self.assertRaises(exception, fn, self.time_period)
     self.time_period = py_period(start, end)
     fn(None, self.time_period, navigation_fn)
 def assert_event_has_period(self, start, end, event=None):
     if event is None:
         event = self.selected_events[0]
     self.assertEquals(event.time_period, py_period(start, end))
 def then_period_becomes(self, start, end):
     self.assertEquals(py_period(start, end), self.new_period)
 def then_event_gets_period(self, start, end):
     self.assertEquals(py_period(start, end),
                       self.event_being_resized.time_period)
Exemple #9
0
 def then_event_gets_period(self, start, end):
     self.assertEquals(
         py_period(start, end),
         self.event_being_resized.time_period)
Exemple #10
0
 def assert_displays_period(self, start, end):
     view_properties = self.get_view_properties_used_when_drawing()
     self.assertEquals(
         py_period(start, end), view_properties.displayed_period)
Exemple #11
0
 def assert_event_has_period(self, event, start, end):
     self.assertEquals(py_period(start, end), event.time_period)
Exemple #12
0
 def init_view_with_db_with_period(self, start, end):
     self.db._set_displayed_period(py_period(start, end))
     self.init_view_with_db()
Exemple #13
0
 def assert_displays_period(self, start, end):
     view_properties = self.get_view_properties_used_when_drawing()
     self.assertEquals(py_period(start, end),
                       view_properties.displayed_period)
Exemple #14
0
 def assert_event_has_period(self, event, start, end):
     self.assertEquals(py_period(start, end), event.time_period)
Exemple #15
0
 def init_view_with_db_with_period(self, start, end):
     self.db._set_displayed_period(py_period(start, end))
     self.init_view_with_db()
Exemple #16
0
 def test_can_move_period_without_zooming(self):
     a = Animation(self.timeline, py_period("1 Jan 2010", "2 Jan 2010"), 2,
                   py_period("3 Jan 2010", "4 Jan 2010"))
     a.change_current_period(1)
     self.assertEquals(a.current_period,
                       py_period("2 Jan 2010", "3 Jan 2010"))
    def assert_navigation_raises(self, exception, fn, start, end):
        def navigation_fn(fn):
            self.assertRaises(exception, fn, self.time_period)

        self.time_period = py_period(start, end)
        fn(None, self.time_period, navigation_fn)
Exemple #18
0
 def given_displayed_period(self, start, end):
     self.view_properties.displayed_period = py_period(start, end)
Exemple #19
0
 def assert_event_has_period(self, start, end, event=None):
     if event is None:
         event = self.selected_events[0]
     self.assertEquals(event.time_period, py_period(start, end))