Example #1
0
    def test_days_between(self):
        from kardboard.util import days_between

        wednesday = datetime.datetime(year=2011, month=6, day=1)
        next_wednesday = datetime.datetime(year=2011, month=6, day=8)
        result = days_between(wednesday, next_wednesday)
        self.assertEqual(result, 7)

        aday = datetime.datetime(year=2011, month=6, day=1)
        manydayslater = datetime.datetime(year=2012, month=6, day=1)
        result = days_between(aday, manydayslater)
        self.assertEqual(result, 366)
Example #2
0
    def ztest_days_between(self):
        from kardboard.util import days_between

        wednesday = datetime.datetime(year=2011, month=6, day=1)
        next_wednesday = datetime.datetime(year=2011, month=6, day=8)
        result = days_between(wednesday, next_wednesday)
        self.assertEqual(result, 7)

        aday = datetime.datetime(year=2011, month=6, day=1)
        manydayslater = datetime.datetime(year=2012, month=6, day=1)
        result = days_between(aday, manydayslater)
        self.assertEqual(result, 366)
Example #3
0
    def test_days_between_partial_days_under(self):
        from kardboard.util import days_between

        start = datetime.datetime(2013, 6, 20, 12, 59, 59)
        end = datetime.datetime(2013, 6, 24, 0, 0, 0, 0)
        result = days_between(start, end)
        self.assertEqual(result, 3)
Example #4
0
 def lead_time(self):
     """
     Caclucation of the number of days between the backlogging of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.done_date:
         return days_between(self.backlog_date, self.done_date)
Example #5
0
    def test_days_between_partial_days_over(self):
        from kardboard.util import days_between

        start = datetime.datetime(2013, 6, 20, 19, 40, 32, 60000)
        end = datetime.datetime(2013, 6, 24, 8, 46, 35, 461000)
        result = days_between(start, end)
        self.assertEqual(result, 4)
Example #6
0
 def cycle_time(self):
     """
     Caclucation of the number of days between the start of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.start_date and self.done_date:
         return days_between(self.start_date, self.done_date)
Example #7
0
 def lead_time(self):
     """
     Caclucation of the number of days between the backlogging of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.done_date:
         return days_between(self.backlog_date, self.done_date)
Example #8
0
 def cycle_time(self):
     """
     Caclucation of the number of days between the start of a card
     and its completion. Returns None if the card hasn't completed yet.
     """
     if self.start_date and self.done_date:
         return days_between(self.start_date, self.done_date)
Example #9
0
    def current_lead_time(self, today=None):
        """
        Caclucation of the number of days between the backlogging of a card
        and a comparison point (defaults to today).
        """
        if not self.backlog_date:
            return None

        if today is None and self.done_date is None:
            today = now()
        elif today is None and self.done_date is not None:
            today = self.done_date
        return days_between(self.backlog_date, today)
Example #10
0
    def current_lead_time(self, today=None):
        """
        Caclucation of the number of days between the backlogging of a card
        and a comparison point (defaults to today).
        """
        if not self.backlog_date:
            return None

        if today is None and self.done_date is None:
            today = now()
        elif today is None and self.done_date is not None:
            today = self.done_date
        return days_between(self.backlog_date, today)
Example #11
0
    def current_cycle_time(self, today=None):
        """
        Caclucation of the number of days between the start of a card
        and a comparison point (defaults to today).
        Returns None if the card hasn't started yet.
        """
        if not self.start_date:
            return None

        if today is None and self.done_date is None:
            today = now()
        elif today is None and self.done_date is not None:
            today = self.done_date
        return days_between(self.start_date, today)
Example #12
0
    def current_cycle_time(self, today=None):
        """
        Caclucation of the number of days between the start of a card
        and a comparison point (defaults to today).
        Returns None if the card hasn't started yet.
        """
        if not self.start_date:
            return None

        if today is None and self.done_date is None:
            today = now()
        elif today is None and self.done_date is not None:
            today = self.done_date
        return days_between(self.start_date, today)