
"""Pyhole Log Unit Tests"""

import os
import unittest

from pyhole.core import logger
from pyhole.core import utils


class TestLogger(unittest.TestCase):
    def test_logger(self):
        test_log_dir = utils.get_home_directory() + "logs/"

        try:
            # NOTE(jk0): If the configuration file doesn't exist, the config
            # class will generate it and raise a SystemExit.
            logger.setup_logger(name="test")
        except SystemExit:
            logger.setup_logger(name="test")

        test_log = logger.get_logger("TEST")

        self.assertEqual("TEST", test_log.name)
        self.assertEqual(test_log.level, 0)

        os.unlink(test_log_dir + "test.log")


"""Pyhole Log Unit Tests"""

import os
import unittest

from pyhole.core import logger
from pyhole.core import utils


class TestLogger(unittest.TestCase):
    def test_logger(self):
        test_log_dir = utils.get_home_directory() + "logs/"

        try:
            # NOTE(jk0): If the configuration file doesn't exist, the config
            # class will generate it and raise a SystemExit.
            logger.setup_logger("test")
        except SystemExit:
            logger.setup_logger("test")

        test_log = logger.get_logger("TEST")

        self.assertEqual("TEST", test_log.name)
        self.assertEqual(test_log.level, 0)

        os.unlink(test_log_dir + "test.log")

Use setup_logger properly in tests.
Use setup_logger properly in tests.

  
  """Pyhole Log Unit Tests"""
  
  import os
  import unittest
  
  from pyhole.core import logger
  from pyhole.core import utils
  
  
  class TestLogger(unittest.TestCase):
      def test_logger(self):
          test_log_dir = utils.get_home_directory() + "logs/"
  
          try:
              # NOTE(jk0): If the configuration file doesn't exist, the config
              # class will generate it and raise a SystemExit.
-             logger.setup_logger(name="test")
+             logger.setup_logger("test")
          except SystemExit:
-             logger.setup_logger(name="test")
+             logger.setup_logger("test")
  
          test_log = logger.get_logger("TEST")
  
          self.assertEqual("TEST", test_log.name)
          self.assertEqual(test_log.level, 0)
  
          os.unlink(test_log_dir + "test.log")
  
Use setup_logger properly in tests.
## Code Before:

"""Pyhole Log Unit Tests"""

import os
import unittest

from pyhole.core import logger
from pyhole.core import utils


class TestLogger(unittest.TestCase):
    def test_logger(self):
        test_log_dir = utils.get_home_directory() + "logs/"

        try:
            # NOTE(jk0): If the configuration file doesn't exist, the config
            # class will generate it and raise a SystemExit.
            logger.setup_logger(name="test")
        except SystemExit:
            logger.setup_logger(name="test")

        test_log = logger.get_logger("TEST")

        self.assertEqual("TEST", test_log.name)
        self.assertEqual(test_log.level, 0)

        os.unlink(test_log_dir + "test.log")

## Instruction:
Use setup_logger properly in tests.
## Code After:

"""Pyhole Log Unit Tests"""

import os
import unittest

from pyhole.core import logger
from pyhole.core import utils


class TestLogger(unittest.TestCase):
    def test_logger(self):
        test_log_dir = utils.get_home_directory() + "logs/"

        try:
            # NOTE(jk0): If the configuration file doesn't exist, the config
            # class will generate it and raise a SystemExit.
            logger.setup_logger("test")
        except SystemExit:
            logger.setup_logger("test")

        test_log = logger.get_logger("TEST")

        self.assertEqual("TEST", test_log.name)
        self.assertEqual(test_log.level, 0)

        os.unlink(test_log_dir + "test.log")
