Пример #1
0
 def test_tail_utf8(self):
     fLOG(__file__,
          self._testMethodName,
          OutputPrint=__name__ == "__main__")
     fp = os.path.join(os.path.dirname(__file__), "data", "lines_utf8.txt")
     lines = file_tail(fp, nbline=3, threshold=20)
     fLOG(lines)
Пример #2
0
 def test_tail_utf8(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     fp = os.path.join(os.path.dirname(__file__), "data", "lines_utf8.txt")
     lines = file_tail(fp, nbline=3, threshold=20)
     fLOG(lines)
Пример #3
0
 def test_tail(self):
     fLOG(__file__,
          self._testMethodName,
          OutputPrint=__name__ == "__main__")
     fp = os.path.abspath(__file__)
     mg = MagicFile()
     fLOG("--", fp)
     res = mg.tail("{0} -n 3".format(fp))
     fLOG("*****", res)
     assert "unittest.main" in res.data
     res = mg.tail("{0} --n 3 -e ascii".format(fp))
     res = mg.tail("{0} --n 3 -e utf8".format(fp))
     res = file_tail(fp, threshold=300, nbline=3)
     res = [_ for _ in res if len(_) > 0]
     fLOG("#####", res)
     if "unittest.main" not in res[-2]:
         raise Exception("unittest.main not in " + str(res[-2]))
Пример #4
0
 def test_tail(self):
     fLOG(
         __file__,
         self._testMethodName,
         OutputPrint=__name__ == "__main__")
     fp = os.path.abspath(__file__)
     mg = MagicFile()
     fLOG("--", fp)
     res = mg.tail("{0} -n 3".format(fp))
     fLOG("*****", res)
     assert "unittest.main" in res.data
     res = mg.tail("{0} --n 3 -e ascii".format(fp))
     res = mg.tail("{0} --n 3 -e utf8".format(fp))
     res = file_tail(fp, threshold=300, nbline=3)
     res = [_ for _ in res if len(_) > 0]
     fLOG("#####", res)
     if "unittest.main" not in res[-1]:
         raise Exception("unittest.main not in " + str(res[-1]))