Пример #1
0
    def test_parse_trimix(self):
        """
        Test parsing trimix gas
        """
        m = parse_gas('TX21/33@10')
        self.assertEqual(21, m.o2)
        self.assertEqual(33, m.he)
        self.assertEqual(10, m.depth)

        m = parse_gas('TX17/18')
        self.assertEqual(17, m.o2)
        self.assertEqual(18, m.he)
        self.assertTrue(m.depth is None)
Пример #2
0
    def test_parse_gas_ean(self):
        """
        Test parsing EAN gas mix
        """
        m = parse_gas('EAN50')
        self.assertEqual(50, m.o2)
        self.assertEqual(0, m.he)
        self.assertTrue(m.depth is None)

        m = parse_gas('ean32@21')
        self.assertEqual(32, m.o2)
        self.assertEqual(0, m.he)
        self.assertEqual(21, m.depth)
Пример #3
0
    def test_parse_gas_air(self):
        """
        Test parsing air gas mix
        """
        m = parse_gas('air')
        self.assertEqual(21, m.o2)
        self.assertEqual(0, m.he)
        self.assertTrue(m.depth is None)

        m = parse_gas('air@0')
        self.assertEqual(21, m.o2)
        self.assertEqual(0, m.he)
        self.assertEqual(0, m.depth)
Пример #4
0
 def test_parse_gas_o2(self):
     """
     Test parsing o2 gas mix
     """
     m = parse_gas('o2@6')
     self.assertEqual(100, m.o2)
     self.assertEqual(0, m.he)
     self.assertEqual(6, m.depth)
Пример #5
0
 def test_parse_gas_unknown(self):
     """
     Test parsing unknown gas mix
     """
     mixes = [
         'EAN50/30', 'O2/30', 'EAN', 'TX@20', 'TX/30', 'EAN100', 'TX100/10'
     ]
     for m in mixes:
         self.assertTrue(parse_gas(m) is None, m)