本文整理匯總了Python中dipplanner.tank.Tank.refill方法的典型用法代碼示例。如果您正苦於以下問題:Python Tank.refill方法的具體用法?Python Tank.refill怎麽用?Python Tank.refill使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dipplanner.tank.Tank
的用法示例。
在下文中一共展示了Tank.refill方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: TestTankRefill
# 需要導入模塊: from dipplanner.tank import Tank [as 別名]
# 或者: from dipplanner.tank.Tank import refill [as 別名]
class TestTankRefill(TestTank):
"""Test Tank Refill."""
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)
def test_vol(self):
"""Test volume calc."""
self.assertAlmostEqual(self.mytank.remaining_gas,
-88.9813390544, 0,
'Wrong Tank Volume : %s'
% self.mytank.remaining_gas)
def test_refill(self):
"""Test volume calc after refill."""
self.mytank.refill()
self.assertAlmostEqual(self.mytank.remaining_gas,
3116.01866095, 0,
'Wrong Tank Volume : %s'
% self.mytank.remaining_gas)
示例2: TestTankRefill
# 需要導入模塊: from dipplanner.tank import Tank [as 別名]
# 或者: from dipplanner.tank.Tank import refill [as 別名]
class TestTankRefill(TestTank):
def setUp(self):
self.mytank = Tank(tank_vol=15, tank_pressure=207)
self.mytank.consume_gas(405)
self.mytank.consume_gas(2800)
def test_vol(self):
self.assertAlmostEqual(
self.mytank.remaining_gas, -88.9813390544, 0, "Wrong Tank Volume : %s" % self.mytank.remaining_gas
)
def test_refill(self):
self.mytank.refill()
self.assertAlmostEqual(
self.mytank.remaining_gas, 3116.01866095, 0, "Wrong Tank Volume : %s" % self.mytank.remaining_gas
)