當前位置: 首頁>>代碼示例>>Python>>正文


Python tank.Tank類代碼示例

本文整理匯總了Python中dipplanner.tank.Tank的典型用法代碼示例。如果您正苦於以下問題:Python Tank類的具體用法?Python Tank怎麽用?Python Tank使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Tank類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: TestTankisHeliox2080_2

class TestTankisHeliox2080_2(TestTank):
    """Test Heliox2080 Tank 2."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(f_o2=0.2, f_he=0.8, max_ppo2=1.4)

    def test_name(self):
        """Check Name."""
        assert str(self.mytank) == 'Heliox 20/80'

    def test_mod(self):
        """Check Calculated mod."""
        assert self.mytank.mod == 59

    def test_mod_at_end(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_mod_for_given_end(30),
                               96.8666243516, 5, 'wrong mod at end:%s'
                               % self.mytank.get_mod_for_given_end(30))

    def test_end_at_depth(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_end_for_given_depth(40),
                               8.70562703148, 5, 'wrong end at depth:%s'
                               % self.mytank.get_end_for_given_depth(40))
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:28,代碼來源:tank_test.py

示例2: TestTankisAir

class TestTankisAir(TestTank):
    """Test Air Tank."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank()

    def test_name(self):
        """Check Name."""
        assert str(self.mytank) == 'Air'

    def test_mod(self):
        """Check Calculated mod."""
        assert self.mytank.mod == 66

    def test_mod_at_end(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_mod_for_given_end(30),
                               31.0195918624, 5, 'wrong mod at end:%s'
                               % self.mytank.get_mod_for_given_end(30))

    def test_end_at_depth(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_end_for_given_depth(40),
                               38.7573409377, 5, 'wrong end at depth:%s'
                               % self.mytank.get_end_for_given_depth(40))

    def test_tank_info(self):
        """Check str output."""
        self.assertEqual(self.mytank.tank_info,
                         '12.0l-100.0% (2423.10/2423.10l)',
                         "Wrong Tank infos: %s"
                         % self.mytank.tank_info)
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:35,代碼來源:tank_test.py

示例3: TestTankisTrimix870_2

class TestTankisTrimix870_2(TestTank):
    """Test Tx8/70 Tank 2."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(f_o2=0.08, f_he=0.7, max_ppo2=1.4)

    def test_name(self):
        """Check Name."""
        assert str(self.mytank) == 'Trimix 8/70'

    def test_mod(self):
        """Check Calculated mod."""
        assert self.mytank.mod == 165

    def test_min_od(self):
        """Check Calculated minimum od."""
        assert self.mytank.get_min_od() == 10

    def test_mod_at_end(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_mod_for_given_end(30),
                               79.0122229175, 5, 'wrong mod at end:%s'
                               % self.mytank.get_mod_for_given_end(30))

    def test_end_at_depth(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_end_for_given_depth(40),
                               12.4620912698, 5, 'wrong end at depth:%s'
                               % self.mytank.get_end_for_given_depth(40))
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:32,代碼來源:tank_test.py

示例4: TestTankisO2_2

class TestTankisO2_2(TestTank):
    def setUp(self):
        self.mytank = Tank(f_o2=1, max_ppo2=1.4)

    def test_name(self):
        assert str(self.mytank) == "Oxygen"

    def test_mod(self):
        assert self.mytank.mod == 4

    def test_mod_at_end(self):
        self.assertAlmostEqual(
            self.mytank.get_mod_for_given_end(30),
            31.0195918624,
            5,
            "wrong mod at end:%s" % self.mytank.get_mod_for_given_end(30),
        )

    def test_end_at_depth(self):
        self.assertAlmostEqual(
            self.mytank.get_end_for_given_depth(40),
            38.7573409377,
            5,
            "wrong end at depth:%s" % self.mytank.get_end_for_given_depth(40),
        )
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:25,代碼來源:tank_test.py

示例5: TestTankisAir2

class TestTankisAir2(TestTank):
    """Test Air Tank 2."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(max_ppo2=1.4)

    def test_name(self):
        """Check Name."""
        assert str(self.mytank) == 'Air'

    def test_mod(self):
        """Check Calculated mod."""
        assert self.mytank.mod == 56

    def test_mod_at_end(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_mod_for_given_end(30),
                               31.0195918624, 5, 'wrong mod at end:%s'
                               % self.mytank.get_mod_for_given_end(30))

    def test_end_at_depth(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_end_for_given_depth(40),
                               38.7573409377, 5, 'wrong end at depth:%s'
                               % self.mytank.get_end_for_given_depth(40))
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:28,代碼來源:tank_test.py

示例6: TestTankisTrimix2030_2

class TestTankisTrimix2030_2(TestTank):
    """Test Tx2030 Tank 2."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(f_o2=0.2, f_he=0.3, max_ppo2=1.4)

    def test_name(self):
        """Check Name."""
        assert str(self.mytank) == 'Trimix 20/30'

    def test_mod(self):
        """Check Calculated mod."""
        assert self.mytank.mod == 59

    def test_mod_at_end(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_mod_for_given_end(30),
                               43.3498554235, 5, 'wrong mod at end:%s'
                               % self.mytank.get_mod_for_given_end(30))

    def test_end_at_depth(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_end_for_given_depth(40),
                               27.4879482229, 5, 'wrong end at depth:%s'
                               % self.mytank.get_end_for_given_depth(40))
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:28,代碼來源:tank_test.py

示例7: TestTankNitrox32

class TestTankNitrox32(TestTank):
    """Test Nitrox32 Tank."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(f_o2=0.32)

    def test_name(self):
        """Check Name."""
        assert str(self.mytank) == 'Nitrox 32'

    def test_mod(self):
        """Check Calculated mod."""
        assert self.mytank.mod == 40

    def test_mod_at_end(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_mod_for_given_end(30),
                               31.0195918624, 5, 'wrong mod at end:%s'
                               % self.mytank.get_mod_for_given_end(30))

    def test_end_at_depth(self):
        """Check Calculated mod at given end."""
        self.assertAlmostEqual(self.mytank.get_end_for_given_depth(40),
                               38.7573409377, 5, 'wrong end at depth:%s'
                               % self.mytank.get_end_for_given_depth(40))
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:28,代碼來源:tank_test.py

示例8: TestTankisTrimix870_2

class TestTankisTrimix870_2(TestTank):
    def setUp(self):
        self.mytank = Tank(f_o2=0.08, f_he=0.7, max_ppo2=1.4)

    def test_name(self):
        assert str(self.mytank) == "Trimix 8/70"

    def test_mod(self):
        assert self.mytank.mod == 165

    def test_min_od(self):
        assert self.mytank.get_min_od() == 10

    def test_mod_at_end(self):
        self.assertAlmostEqual(
            self.mytank.get_mod_for_given_end(30),
            79.0122229175,
            5,
            "wrong mod at end:%s" % self.mytank.get_mod_for_given_end(30),
        )

    def test_end_at_depth(self):
        self.assertAlmostEqual(
            self.mytank.get_end_for_given_depth(40),
            12.4620912698,
            5,
            "wrong end at depth:%s" % self.mytank.get_end_for_given_depth(40),
        )
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:28,代碼來源:tank_test.py

示例9: TestTankisHeliox2080_2

class TestTankisHeliox2080_2(TestTank):
    def setUp(self):
        self.mytank = Tank(f_o2=0.2, f_he=0.8, max_ppo2=1.4)

    def test_name(self):
        assert str(self.mytank) == "Heliox 20/80"

    def test_mod(self):
        assert self.mytank.mod == 59

    def test_mod_at_end(self):
        self.assertAlmostEqual(
            self.mytank.get_mod_for_given_end(30),
            96.8666243516,
            5,
            "wrong mod at end:%s" % self.mytank.get_mod_for_given_end(30),
        )

    def test_end_at_depth(self):
        self.assertAlmostEqual(
            self.mytank.get_end_for_given_depth(40),
            8.70562703148,
            5,
            "wrong end at depth:%s" % self.mytank.get_end_for_given_depth(40),
        )
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:25,代碼來源:tank_test.py

示例10: TestTankVolume3

class TestTankVolume3(TestTank):
    def setUp(self):
        self.mytank = Tank(tank_vol=15, tank_pressure=207)

    def test_vol(self):
        self.mytank.consume_gas(405)
        self.assertAlmostEqual(self.mytank.remaining_gas, 2711, 0, "Wrong Tank Volume : %s" % self.mytank.remaining_gas)
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:7,代碼來源:tank_test.py

示例11: TestTankNitrox32

class TestTankNitrox32(TestTank):
    def setUp(self):
        self.mytank = Tank(f_o2=0.32)

    def test_name(self):
        assert str(self.mytank) == "Nitrox 32"

    def test_mod(self):
        assert self.mytank.mod == 40

    def test_mod_at_end(self):
        self.assertAlmostEqual(
            self.mytank.get_mod_for_given_end(30),
            31.0195918624,
            5,
            "wrong mod at end:%s" % self.mytank.get_mod_for_given_end(30),
        )

    def test_end_at_depth(self):
        self.assertAlmostEqual(
            self.mytank.get_end_for_given_depth(40),
            38.7573409377,
            5,
            "wrong end at depth:%s" % self.mytank.get_end_for_given_depth(40),
        )
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:25,代碼來源:tank_test.py

示例12: TestTankisTrimix2030_2

class TestTankisTrimix2030_2(TestTank):
    def setUp(self):
        self.mytank = Tank(f_o2=0.2, f_he=0.3, max_ppo2=1.4)

    def test_name(self):
        assert str(self.mytank) == "Trimix 20/30"

    def test_mod(self):
        assert self.mytank.mod == 59

    def test_mod_at_end(self):
        self.assertAlmostEqual(
            self.mytank.get_mod_for_given_end(30),
            43.3498554235,
            5,
            "wrong mod at end:%s" % self.mytank.get_mod_for_given_end(30),
        )

    def test_end_at_depth(self):
        self.assertAlmostEqual(
            self.mytank.get_end_for_given_depth(40),
            27.4879482229,
            5,
            "wrong end at depth:%s" % self.mytank.get_end_for_given_depth(40),
        )
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:25,代碼來源:tank_test.py

示例13: TestTankVolume4

class TestTankVolume4(TestTank):
    def setUp(self):
        self.mytank = Tank(tank_vol=15, tank_pressure=207)

    def test_vol(self):
        self.mytank.consume_gas(405)
        self.mytank.consume_gas(2800)
        self.assertEqual(
            self.mytank.check_rule(),
            False,
            "Wrong tank status : it should fail the remaining " "gas rule test (result:%s)" % self.mytank.check_rule(),
        )
開發者ID:hordurk,項目名稱:dipplanner,代碼行數:12,代碼來源:tank_test.py

示例14: TestTankVolume3

class TestTankVolume3(TestTank):
    """Test Tank Volume 3."""

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(tank_vol=15, tank_pressure=207)

    def test_vol(self):
        """Test volume calc."""
        self.mytank.consume_gas(405)
        self.assertAlmostEqual(self.mytank.remaining_gas, 2711, 0,
                               'Wrong Tank Volume : %s'
                               % self.mytank.remaining_gas)
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:15,代碼來源:tank_test.py

示例15: setUp

    def setUp(self):
        """Init of the tests."""
        super().setUp()

        self.mytank = Tank(tank_vol=15, tank_pressure=207)
        self.mytank.consume_gas(405)
        self.mytank.consume_gas(2800)
開發者ID:ThomasChiroux,項目名稱:dipplanner,代碼行數:7,代碼來源:tank_test.py


注:本文中的dipplanner.tank.Tank類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。