示例#1
0
    def get_full_desat_hhmmss(self):
        """Return full desat time (if calculated) in hhmmss format.

        instead of an int in seconds

        :returns: "hh:mm:ss" full desat time
        :rtype: str
        """
        if self.full_desat_time_value is not None:
            return seconds_to_hhmmss(self.full_desat_time_value)
        else:
            return seconds_to_hhmmss(self.full_desat_time())
示例#2
0
    def get_full_desat_hhmmss(self):
        """Return full desat time (if calculated) in hhmmss format.

        instead of an int in seconds

        :returns: "hh:mm:ss" full desat time
        :rtype: str
        """
        if self.full_desat_time_value is not None:
            return seconds_to_hhmmss(self.full_desat_time_value)
        else:
            return seconds_to_hhmmss(self.full_desat_time())
示例#3
0
 def test_seconds_to_hhmmss_5(self):
     try:
         result = seconds_to_hhmmss(-10)
     except ValueError:
         pass
     else:
         self.fail('should raise ValueError')
示例#4
0
 def test_seconds_to_hhmmss_5(self):
     try:
         _ = seconds_to_hhmmss(-10)
     except ValueError:
         pass
     else:
         self.fail('should raise ValueError')
示例#5
0
    def get_no_flight_hhmmss(self):
        """Return no flight time (if calculated) in hhmmss format.

        instead of an int in seconds

        .. note::

           This method does not calculate no_flight_time
           you need to call no_flight_time() or
           no_flight_time_wo_exception() before.

        :returns: "hh:mm:ss" no flight time
                  "" (empty string) if no flight time is not calculated
        :rtype: str
        """
        if self.no_flight_time_value is not None:
            return seconds_to_hhmmss(self.no_flight_time_value)
        else:
            return ""
示例#6
0
    def get_no_flight_hhmmss(self):
        """Return no flight time (if calculated) in hhmmss format.

        instead of an int in seconds

        .. note::

           This method does not calculate no_flight_time
           you need to call no_flight_time() or
           no_flight_time_wo_exception() before.

        :returns: "hh:mm:ss" no flight time
                  "" (empty string) if no flight time is not calculated
        :rtype: str
        """
        if self.no_flight_time_value is not None:
            return seconds_to_hhmmss(self.no_flight_time_value)
        else:
            return ""
示例#7
0
    def get_no_flight_hhmmss(self):
        """Returns no flight time (if calculated) in hhmmss format
        instead of an int in seconds

        .. note::

           This method does not calculate no_flight_time
           you need to call no_flight_time() or
           no_flight_time_wo_exception() before.

        *Keyword Arguments:*
            <none>

        Returns:
            str -- "hh:mm:ss" no flight time
            str -- "" if no flight time is not calculated
        """
        if self.no_flight_time_value is not None:
            return seconds_to_hhmmss(self.no_flight_time_value)
        else:
            return ""
示例#8
0
 def test_seconds_to_hhmmss_4(self):
     self.assertEqual(seconds_to_hhmmss(447851), "124:24:11",
         "Wrong output for seconds to hhmmss: %s"
         % seconds_to_hhmmss(447851))
示例#9
0
 def test_seconds_to_hhmmss_3(self):
     self.assertEqual(seconds_to_hhmmss(875), "00:14:35",
         "Wrong output for seconds to hhmmss: %s"
         % seconds_to_hhmmss(875))
示例#10
0
 def test_seconds_to_hhmmss_2(self):
     self.assertEqual(seconds_to_hhmmss(100), "00:01:40",
         "Wrong output for seconds to hhmmss: %s"
         % seconds_to_hhmmss(100))
示例#11
0
 def test_seconds_to_hhmmss_4(self):
     self.assertEqual(
         seconds_to_hhmmss(447851), "124:24:11",
         "Wrong output for seconds to hhmmss: %s" %
         seconds_to_hhmmss(447851))
示例#12
0
 def test_seconds_to_hhmmss_3(self):
     self.assertEqual(
         seconds_to_hhmmss(875), "00:14:35",
         "Wrong output for seconds to hhmmss: %s" % seconds_to_hhmmss(875))
示例#13
0
 def test_seconds_to_hhmmss_2(self):
     self.assertEqual(
         seconds_to_hhmmss(100), "00:01:40",
         "Wrong output for seconds to hhmmss: %s" % seconds_to_hhmmss(100))