コード例 #1
0
ファイル: test_ert_log.py プロジェクト: Ensembles/ert
    def test_getFilename(self):
        with TestAreaContext("python/ert_log/log") as work_area:
            test_log_filename = "log_test_file.txt"
            ErtLog.init(1, test_log_filename, True)
            message = "This is fun"
            ErtLog.log(1, message)

            self.assertEqual(ErtLog.getFilename(), test_log_filename)
コード例 #2
0
ファイル: test_ert_log.py プロジェクト: blattms/ert-debian
    def test_getFilename(self):
        with TestAreaContext("python/ert_log/log") as work_area:
            test_log_filename = "log_test_file.txt"
            ErtLog.init(1, test_log_filename, True)
            message = "This is fun"
            ErtLog.log(1, message)

            self.assertEqual(ErtLog.getFilename(), test_log_filename)
コード例 #3
0
ファイル: test_ert_log.py プロジェクト: Ensembles/ert
    def test_log(self):
        with TestAreaContext("python/ert_log/log") as work_area:
            test_log_filename = "test_log"
            ErtLog.init(1, test_log_filename, True)
            message = "This is fun"
            ErtLog.log(1, message)

            self.assertTrue(os.path.isfile(test_log_filename))

            with open(test_log_filename, "r") as f:
                text = f.readlines()
                self.assertTrue(len(text) > 0)
                self.assertTrue(message in text[-1])
コード例 #4
0
ファイル: test_ert_log.py プロジェクト: blattms/ert-debian
    def test_log(self):
        with TestAreaContext("python/ert_log/log") as work_area:
            test_log_filename = "test_log"
            ErtLog.init(1, test_log_filename, True)
            message = "This is fun"
            ErtLog.log(1, message)

            self.assertTrue(os.path.isfile(test_log_filename))

            with open(test_log_filename, "r") as f:
                text = f.readlines()
                self.assertTrue(len(text) > 0)
                self.assertTrue(message in text[-1])