"""Unittest of configuration loading."""

import os
import unittest
from unittest import mock

from yanico import config


class TestUserPath(unittest.TestCase):
    """Test for yanico.config.user_path()."""

    @mock.patch.dict(os.environ, {'HOME': 'spam'})
    def test_path(self):
        """Expect filepath joinning '.yanico.conf' under $HOME."""
        if os.sep == '\\':
            expect = 'spam\\.yanico.conf'
        elif os.sep == '/':
            expect = 'spam/.yanico.conf'
        result = config.user_path()
        self.assertEqual(result, expect)

"""Unittest of configuration loading."""

import os
import unittest
from unittest import mock

from yanico import config


class TestUserPath(unittest.TestCase):
    """Test for yanico.config.user_path()."""

    @mock.patch.dict(os.environ, {'HOME': 'spam'})
    def test_path(self):
        """Expect filepath joinning '.yanico.conf' under $HOME."""
        if os.sep == '\\':
            expect = 'spam\\.yanico.conf'
        elif os.sep == '/':
            expect = 'spam/.yanico.conf'
        result = config.user_path()
        self.assertEqual(result, expect)

    @mock.patch('yanico.config.CONFIG_FILENAME', new='ham.egg')
    def test_dependence_constants(self):
        """Expect to depend filename by 'CONFIG_FILENAME' constants."""
        result = config.user_path()
        self.assertEqual(os.path.basename(result), 'ham.egg')

Add test case for dependence constants
Add test case for dependence constants

Expect to depend filename by 'CONFIG_FILENAME' constants.

  """Unittest of configuration loading."""
  
  import os
  import unittest
  from unittest import mock
  
  from yanico import config
  
  
  class TestUserPath(unittest.TestCase):
      """Test for yanico.config.user_path()."""
  
      @mock.patch.dict(os.environ, {'HOME': 'spam'})
      def test_path(self):
          """Expect filepath joinning '.yanico.conf' under $HOME."""
          if os.sep == '\\':
              expect = 'spam\\.yanico.conf'
          elif os.sep == '/':
              expect = 'spam/.yanico.conf'
          result = config.user_path()
          self.assertEqual(result, expect)
  
+     @mock.patch('yanico.config.CONFIG_FILENAME', new='ham.egg')
+     def test_dependence_constants(self):
+         """Expect to depend filename by 'CONFIG_FILENAME' constants."""
+         result = config.user_path()
+         self.assertEqual(os.path.basename(result), 'ham.egg')
+ 
Add test case for dependence constants
## Code Before:
"""Unittest of configuration loading."""

import os
import unittest
from unittest import mock

from yanico import config


class TestUserPath(unittest.TestCase):
    """Test for yanico.config.user_path()."""

    @mock.patch.dict(os.environ, {'HOME': 'spam'})
    def test_path(self):
        """Expect filepath joinning '.yanico.conf' under $HOME."""
        if os.sep == '\\':
            expect = 'spam\\.yanico.conf'
        elif os.sep == '/':
            expect = 'spam/.yanico.conf'
        result = config.user_path()
        self.assertEqual(result, expect)

## Instruction:
Add test case for dependence constants
## Code After:
"""Unittest of configuration loading."""

import os
import unittest
from unittest import mock

from yanico import config


class TestUserPath(unittest.TestCase):
    """Test for yanico.config.user_path()."""

    @mock.patch.dict(os.environ, {'HOME': 'spam'})
    def test_path(self):
        """Expect filepath joinning '.yanico.conf' under $HOME."""
        if os.sep == '\\':
            expect = 'spam\\.yanico.conf'
        elif os.sep == '/':
            expect = 'spam/.yanico.conf'
        result = config.user_path()
        self.assertEqual(result, expect)

    @mock.patch('yanico.config.CONFIG_FILENAME', new='ham.egg')
    def test_dependence_constants(self):
        """Expect to depend filename by 'CONFIG_FILENAME' constants."""
        result = config.user_path()
        self.assertEqual(os.path.basename(result), 'ham.egg')
