Пример #1
0
 def runTest(self):
     diveseg1 = SegmentDive(30, 30 * 60, self.airtank, 0)
     self.profile1 = Dive([diveseg1], [self.airtank])
     self.profile1.do_dive()
     self.assertEqual(seconds_to_mmss(self.profile1.run_time),
                      ' 48:24', 'bad dive runtime ? (%s)'
                      % seconds_to_mmss(self.profile1.run_time))
Пример #2
0
 def runTest(self):
     diveseg2 = SegmentDive(20, 30 * 60, self.airtank, 0)
     self.profile2 = Dive([diveseg2], [self.airtank])
     self.profile2.do_dive()
     self.assertEqual(seconds_to_mmss(self.profile2.run_time),
                      ' 32:04', 'bad dive runtime (%s)'
                      % seconds_to_mmss(self.profile2.run_time))
Пример #3
0
 def runTest(self):
     diveseg3 = SegmentDive(55, 30 * 60, self.airdouble, 0)
     self.profile3 = Dive([diveseg3], [self.airdouble])
     self.profile3.do_dive()
     self.assertEqual(seconds_to_mmss(self.profile3.run_time),
                      '131:05', 'bad dive runtime (%s)'
                      % seconds_to_mmss(self.profile3.run_time))
Пример #4
0
 def runTest(self):
     diveseg1 = SegmentDive(30, 30 * 60, self.txtank1, 0)
     self.profile1 = Dive([diveseg1], [self.txtank1])
     self.profile1.do_dive()
     self.assertEqual(seconds_to_mmss(self.profile1.run_time),
                      ' 55:03', 'bad dive runtime (%s)'
                      % seconds_to_mmss(self.profile1.run_time))
Пример #5
0
    def get_surface_interval(self):
        """Return surface interval in mm:ss format.

        :returns: surface interval time in mmm:ss format
        :rtype: str
        """
        return seconds_to_mmss(self.surface_interval)
Пример #6
0
    def get_surface_interval(self):
        """Return surface interval in mm:ss format.

        :returns: surface interval time in mmm:ss format
        :rtype: str
        """
        return seconds_to_mmss(self.surface_interval)
Пример #7
0
 def test_seconds_to_mmss_5(self):
     try:
         _ = seconds_to_mmss(-10)
     except ValueError:
         pass
     else:
         self.fail('should raise ValueError')
Пример #8
0
    def run_time_str(self):
        """Return runtime for humans in the form MMM:SS.

        :returns: segment time in the form MMM:SS
        :rtype: str
        """
        return seconds_to_mmss(self.run_time)
Пример #9
0
 def test_seconds_to_mmss_5(self):
     try:
         result = seconds_to_mmss(-10)
     except ValueError:
         pass
     else:
         self.fail('should raise ValueError')
Пример #10
0
 def details(self):
     """print detailed results."""
     return '"%s": ["%s", %f, %f, %d, %d, %f, %s, %f, %s], ' % (
         self.name, seconds_to_mmss(self.profile1.run_time),
         self.profile1.model.ox_tox.otu, self.profile1.model.ox_tox.cns *
         100, self.profile1.no_flight_time(),
         self.profile1.full_desat_time(), self.profile1.tanks[0].used_gas,
         str(self.profile1.tanks[0].check_rule()).lower(),
         self.profile1.tanks[1].used_gas,
         str(self.profile1.tanks[1].check_rule()).lower())
Пример #11
0
    def details(self):
        """Output details of the dive.

        :returns: string
        :rtype: str
        """
        return '"%s": ["%s", %f, %f, %d, %d, %f, %s], ' % (
            self.name, seconds_to_mmss(self.profile1.run_time),
            self.profile1.model.ox_tox.otu, self.profile1.model.ox_tox.cns *
            100, self.profile1.no_flight_time(),
            self.profile1.full_desat_time(), self.profile1.tanks[0].used_gas,
            str(self.profile1.tanks[0].check_rule()).lower())
Пример #12
0
    def get_surface_interval(self):
        """Returns surface interval in mm:ss format

        *Keyword Arguments:*
            <nothing>

        *Returns:*
            str -- surface interval time in mmm:ss format

        *Raise:*
            <nothing>
        """
        return seconds_to_mmss(self.surface_interval)
Пример #13
0
 def details(self):
     """print detailed results."""
     return '"%s": ["%s", %f, %f, %d, %d, %f, %s, %f, %s], ' % (
         self.name,
         seconds_to_mmss(self.profile1.run_time),
         self.profile1.model.ox_tox.otu,
         self.profile1.model.ox_tox.cns * 100,
         self.profile1.no_flight_time(),
         self.profile1.full_desat_time(),
         self.profile1.tanks[0].used_gas,
         str(self.profile1.tanks[0].check_rule()).lower(),
         self.profile1.tanks[1].used_gas,
         str(self.profile1.tanks[1].check_rule()).lower())
Пример #14
0
    def details(self):
        """Output details of the dive.

        :returns: string
        :rtype: str
        """
        return '"%s": ["%s", %f, %f, %d, %d, %f, %s], ' % (
            self.name,
            seconds_to_mmss(self.profile1.run_time),
            self.profile1.model.ox_tox.otu,
            self.profile1.model.ox_tox.cns * 100,
            self.profile1.no_flight_time(),
            self.profile1.full_desat_time(),
            self.profile1.tanks[0].used_gas,
            str(self.profile1.tanks[0].check_rule()).lower())
Пример #15
0
 def test_seconds_to_mmss_4(self):
     self.assertEqual(seconds_to_mmss(447851), "7464:11",
         "Wrong output for seconds to mmss: %s"
         % seconds_to_mmss(447851))
Пример #16
0
 def test_seconds_to_mmss_3(self):
     self.assertEqual(seconds_to_mmss(875), " 14:35",
         "Wrong output for seconds to mmss: %s"
         % seconds_to_mmss(875))
Пример #17
0
 def test_seconds_to_mmss_2(self):
     self.assertEqual(seconds_to_mmss(100), "  1:40",
         "Wrong output for seconds to mmss: %s"
         % seconds_to_mmss(100))
Пример #18
0
 def test_seconds_to_mmss_2(self):
     self.assertEqual(
         seconds_to_mmss(100), "  1:40",
         "Wrong output for seconds to mmss: %s" % seconds_to_mmss(100))
Пример #19
0
 def test_seconds_to_mmss_3(self):
     self.assertEqual(
         seconds_to_mmss(875), " 14:35",
         "Wrong output for seconds to mmss: %s" % seconds_to_mmss(875))
Пример #20
0
 def test_seconds_to_mmss_4(self):
     self.assertEqual(
         seconds_to_mmss(447851), "7464:11",
         "Wrong output for seconds to mmss: %s" % seconds_to_mmss(447851))
Пример #21
0
 def test_rt(self):
     assert seconds_to_mmss(self.profile1.run_time) == '124:44', \
         'bad dive runtime ? (%s)' \
         % seconds_to_mmss(self.profile1.run_time)
Пример #22
0
 def test_rt(self):
     assert seconds_to_mmss(self.profile3.run_time) == ' 72:40', \
         'bad dive runtime ? (%s)' \
         % seconds_to_mmss(self.profile3.run_time)
Пример #23
0
 def test_rt(self):
     """Check runtime."""
     self.assertEqual(seconds_to_mmss(self.profile1.run_time),
                      self.results[self.name][0],
                      "bad dive runtime ? (%s)" %
                      seconds_to_mmss(self.profile1.run_time))
Пример #24
0
 def test_rt(self):
     """Check runtime."""
     self.assertEqual(
         seconds_to_mmss(self.profile1.run_time),
         self.results[self.name][0], "bad dive runtime ? (%s)" %
         seconds_to_mmss(self.profile1.run_time))