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))
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))
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))
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))
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)
def test_seconds_to_mmss_5(self): try: _ = seconds_to_mmss(-10) except ValueError: pass else: self.fail('should raise ValueError')
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)
def test_seconds_to_mmss_5(self): try: result = seconds_to_mmss(-10) except ValueError: pass else: self.fail('should raise ValueError')
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())
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())
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)
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))
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))
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))
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))
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))
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))
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)
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)
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))
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))