def testLogFilePathExists(self): # Directory containing the log file should be created; loggin_support.py line 250-257 with self._redirectLogBase("logging_example", _SAMPLE_CONNECTION_CONTENTS): temp_ls = LS() temp_ls.initLogging("DEBUG", "stderr", True) path = temp_ls.getApplicationLogFilePath() self.assertTrue(os.path.isdir(os.path.dirname(path)))
def testLogFilePathExists(self): # Directory containing the log file should be created; loggin_support.py line 250-257 with self._redirectLogBase("logging_example", _SAMPLE_CONNECTION_CONTENTS): temp_ls = LS() temp_ls.initLogging("DEBUG", "stderr", True) path = temp_ls.getApplicationLogFilePath() self.assertTrue(os.path.isdir(os.path.dirname(path)))
def testLoggingAppPath(self): # getApplicationLogFilePath() should return path to ../appName.log appName = os.path.splitext(os.path.basename(sys.argv[0]))[0] with self._redirectLogBase(appName, _SAMPLE_CONNECTION_CONTENTS): tempLS = LS() tempLS.initLogging("DEBUG", "stderr", True) self.assertEqual(os.path.abspath(os.path.join(tempLS.getLoggingRootDir(), "processes", appName + ".log")), tempLS.getApplicationLogFilePath()) self.assertIn(appName, ["py", "run_tests"])
def testLoggingAppPath(self): # getApplicationLogFilePath() should return path to ../app_name.log app_name = "py" # Because called with py.test with self._redirectLogBase(app_name, _SAMPLE_CONNECTION_CONTENTS): temp_ls = LS() temp_ls.initLogging("DEBUG", "stderr", True) self.assertEqual( os.path.abspath( os.path.join(temp_ls.getLoggingRootDir(), "processes", app_name + ".log")), temp_ls.getApplicationLogFilePath())
def testLoggingAppPath(self): # getApplicationLogFilePath() should return path to ../appName.log appName = os.path.splitext(os.path.basename(sys.argv[0]))[0] with self._redirectLogBase(appName, _SAMPLE_CONNECTION_CONTENTS): tempLS = LS() tempLS.initLogging("DEBUG", "stderr", True) self.assertEqual( os.path.abspath( os.path.join(tempLS.getLoggingRootDir(), "processes", appName + ".log")), tempLS.getApplicationLogFilePath()) self.assertIn(appName, ["py", "run_tests"])
def testLoggingAppPath(self): # getApplicationLogFilePath() should return path to ../app_name.log app_name = "py" # Because called with py.test with self._redirectLogBase(app_name, _SAMPLE_CONNECTION_CONTENTS): temp_ls = LS() temp_ls.initLogging("DEBUG", "stderr", True) self.assertEqual(os.path.abspath(os.path.join(temp_ls.getLoggingRootDir(), "processes", app_name + ".log")), temp_ls.getApplicationLogFilePath())