# Path: lib/utils/util.py
# def load_env_config():
#     env_path = Path('.') / '.env'
#     load_dotenv(dotenv_path=env_path,
#                 verbose=True,
#                 override=False)
# 
# Path: lib/utils/util.py
# def get_dictsites(filename):
#     dictsites = []
#     with open(filename, 'rU') as f:
#         reader = csv.reader(f, delimiter=',')
#         for row in reader:
#             dictsites.append(row)
#     return dictsites


import unittest
import os
from lib.utils.util import load_env_config
from lib.utils.util import get_dictsites



class TestUtils(unittest.TestCase):

    def test_default_env_settings(self):
        load_env_config()

        self.assertEqual("root", os.getenv("MYSQL_USERNAME"))
        self.assertEqual("password", os.getenv("MYSQL_PASSWORD"))
        self.assertEqual("localhost", os.getenv("MYSQL_HOST"))
        self.assertEqual("headers", os.getenv("MYSQL_DATABASE"))

    def test_custom_env_settings(self):
        os.environ['MYSQL_USERNAME'] = "custom_user"
        os.environ['MYSQL_PASSWORD'] = "custom_password"
        os.environ['MYSQL_HOST'] = "custom_host"
        os.environ['MYSQL_DATABASE'] = "custom_db"


# Path: lib/utils/util.py
# def load_env_config():
#     env_path = Path('.') / '.env'
#     load_dotenv(dotenv_path=env_path,
#                 verbose=True,
#                 override=False)
# 
# Path: lib/utils/util.py
# def get_dictsites(filename):
#     dictsites = []
#     with open(filename, 'rU') as f:
#         reader = csv.reader(f, delimiter=',')
#         for row in reader:
#             dictsites.append(row)
#     return dictsites


# Path: tests/test_utils.py
import unittest
import os
from lib.utils.util import load_env_config
from lib.utils.util import get_dictsites




class TestUtils(unittest.TestCase):

    def test_default_env_settings(self):
        load_env_config()

        self.assertEqual("root", os.getenv("MYSQL_USERNAME"))
        self.assertEqual("password", os.getenv("MYSQL_PASSWORD"))
        self.assertEqual("localhost", os.getenv("MYSQL_HOST"))
        self.assertEqual("headers", os.getenv("MYSQL_DATABASE"))

    def test_custom_env_settings(self):
        os.environ['MYSQL_USERNAME'] = "custom_user"
        os.environ['MYSQL_PASSWORD'] = "custom_password"
        os.environ['MYSQL_HOST'] = "custom_host"
        os.environ['MYSQL_DATABASE'] = "custom_db"


        load_env_config()