def test_get_accessible_log_path(self): """Test suite for get_accessible_log_path method.""" path = qs_logger.get_accessible_log_path("reservation_id", "handler_name") self.assertRegexpMatches( path, r"Logs[\\/]reservation_id[\\/](.*[\\/])?" r"handler_name--\d{2}-\w+-\d{4}--\d{2}-\d{2}-\d{2}\.log", )
def test_get_accessible_log_path_default_params(self): """Test suite for get_accessible_log_path method.""" path = qs_logger.get_accessible_log_path() self.assertRegexpMatches( path, r"Logs[\\/]Autoload[\\/](.*[\\/])?default--\d{2}-\w+-" r"\d{4}--\d{2}-\d{2}-\d{2}\.log", ) self.assertTrue(os.path.dirname(path))
def test_get_accessible_log_path_log_path_is_none(self): """Test suite for get_accessible_log_path method.""" if "LOG_PATH" in os.environ: del os.environ["LOG_PATH"] qs_logger.get_settings = wrong_settings self.assertIsNone(qs_logger.get_accessible_log_path())
def test_get_accessible_log_path_path_creation(self): """Test suite for get_accessible_log_path method.""" path = qs_logger.get_accessible_log_path() self.assertTrue(os.path.dirname(path))