Example #1
0
 def test_06(self):
     """TestLogHeader.test_06(): Plot as top of log."""
     myLh = LogHeader.APIHeaderLIS(isTopOfLog=True)
     fp = TestPlotShared.outPath(TEST_SVG_FILE_MAP_HDR[41].fileName)
     tl = Coord.Pt(Coord.Dim(0.0, 'in'), Coord.Dim(0.0, 'in'))
     viewPort = myLh.viewPort(tl)
     with SVGWriter.SVGWriter(open(fp, 'w'), viewPort) as xS:
         myLh.plot(xS, tl)
Example #2
0
 def test_10(self):
     """TestLogHeader.test_10(): Plot as not top of log with CONS data."""
     myLh = LogHeader.APIHeaderLIS(isTopOfLog=False)
     fp = TestPlotShared.outPath(TEST_SVG_FILE_MAP_HDR[45].fileName)
     tl = Coord.Pt(Coord.Dim(0.25, 'in'), Coord.Dim(0.5, 'in'))
     viewPort = myLh.viewPort(tl)
     with SVGWriter.SVGWriter(open(fp, 'w'), viewPort) as xS:
         myLh.plot(xS, tl, [self._lrCONS,])
Example #3
0
    def test_02(self):
        """TestLogHeader.test_02(): MNEM count and LogHeader.lrDataCount()."""
        self.assertEqual(53, len(self._lrCONS))
        myLh = LogHeader.APIHeaderLIS(isTopOfLog=True)
        self.assertEqual(53, myLh.lrDataCount([self._lrCONS,]))
#        print()
#        print(myLh.missingFields([self._lrCONS,]))
        self.assertEqual((set(), set()), myLh.missingFields([self._lrCONS,]))
Example #4
0
    def test_05(self):
        """TestLogHeader.test_05(): Plot as not top of log."""
        myLh = LogHeader.APIHeaderLIS(isTopOfLog=False)
#        fp = os.path.join('test_svg', 'APIHeader_05.svg')
        fp = TestPlotShared.outPath(TEST_SVG_FILE_MAP_HDR[40].fileName)
        tl = Coord.Pt(Coord.Dim(0.0, 'in'), Coord.Dim(0.0, 'in'))
        viewPort = myLh.viewPort(tl)
        with SVGWriter.SVGWriter(open(fp, 'w'), viewPort) as xS:
            myLh.plot(xS, tl)
Example #5
0
 def test_04(self):
     """TestLogHeader.test_04(): APIHeaderLIS.viewPort()."""
     myLh = LogHeader.APIHeaderLIS(isTopOfLog=False)
     self.assertEqual(
         Coord.Box(width=Coord.Dim(value=6.25, units='in'), depth=Coord.Dim(value=8.0, units='in')),
         myLh.size(),
     )
     tl = Coord.Pt(Coord.Dim(0.25, 'in'), Coord.Dim(0.5, 'in'))
     self.assertEqual(
         Coord.Box(width=Coord.Dim(value=6.5, units='in'), depth=Coord.Dim(value=8.5, units='in')),
         myLh.viewPort(tl),
     )
Example #6
0
 def test_23(self):
     """TestLogHeader.test_23(): Fails with Logical Record that is missing 'VALU' column."""
     myB = [
         bytes([34, 0]),
         bytes([73, 65, 4, 0]),
         bytes('TYPE', 'ascii'),
         bytes('    ', 'ascii'),
         bytes('CONS', 'ascii'),
     ]
     myB.append(bytes([0, 65, 4, 0]))
     myB.append(b'MNEM')
     myB.append(b'    ')
     myB.append(b'HIDE')
     myB.append(bytes([69, 65, 4, 0]))
     myB.append(b'valu')
     myB.append(b'    ')
     myB.append(b'Well')
     myF = self._retFilePrS(b''.join(myB))
     myLrCONS = LogiRec.LrTableRead(myF)
     myLh = LogHeader.APIHeaderLIS(isTopOfLog=False)
     tl = Coord.Pt(Coord.Dim(0.0, 'in'), Coord.Dim(0.0, 'in'))
     self.assertRaises(LogHeader.ExceptionLogHeader, myLh.plot, None, tl, [myLrCONS,])