# Path: src/tests/behave/common/config.py
# def get_conflagration(config_file_paths=DEFAULT_CONFIG_FILES):
#     """Instantiate a conflagration instance.
# 
#     This defaults to loading from two files:
# 
#     1. mercury_tests_creds.config - contains sensitive information
#     2. mercury_tests.config - contains non-sensitive information
# 
#     This lets us encrypt just the sensitive bits for jenkins and quickly make
#     changes to the non-sensitive configs, which we can store in plaintext.
#     """
#     here = os.getcwd()
#     paths = [os.path.join(here, filename) for filename in config_file_paths]
#     if config_file_paths:
#         cfg = api.conflagration(files=paths, namespace_obj=ModifiableNamespace())
#     else:
#         cfg = api.conflagration(default_to_env=True)
#     return cfg


import datetime
import logging
import os
import unittest
from collections import defaultdict
from src.tests.behave.common.config import get_conflagration



LOGS_DIR = os.environ.get("BEHAVE_LOGS_DIR", "./logs")


class Loggers(object):

    def __init__(self, loglevel=logging.DEBUG):
        self.feature = logging.getLogger("behave.feature")
        self.feature.setLevel(loglevel)
        self.scenario = logging.getLogger("behave.scenario")
        self.scenario.setLevel(loglevel)
        self.step = logging.getLogger("behave.step")
        self.step.setLevel(loglevel)
        self.all = logging.getLogger("behave.all")
        self.all.setLevel(loglevel)


def before_all(context):
    """
    :type context: behave.runner.Context
    """

    # Test config

# Path: src/tests/behave/common/config.py
# def get_conflagration(config_file_paths=DEFAULT_CONFIG_FILES):
#     """Instantiate a conflagration instance.
# 
#     This defaults to loading from two files:
# 
#     1. mercury_tests_creds.config - contains sensitive information
#     2. mercury_tests.config - contains non-sensitive information
# 
#     This lets us encrypt just the sensitive bits for jenkins and quickly make
#     changes to the non-sensitive configs, which we can store in plaintext.
#     """
#     here = os.getcwd()
#     paths = [os.path.join(here, filename) for filename in config_file_paths]
#     if config_file_paths:
#         cfg = api.conflagration(files=paths, namespace_obj=ModifiableNamespace())
#     else:
#         cfg = api.conflagration(default_to_env=True)
#     return cfg


# Path: src/tests/behave/agent/features/environment.py
import datetime
import logging
import os
import unittest
from collections import defaultdict
from src.tests.behave.common.config import get_conflagration




LOGS_DIR = os.environ.get("BEHAVE_LOGS_DIR", "./logs")


class Loggers(object):

    def __init__(self, loglevel=logging.DEBUG):
        self.feature = logging.getLogger("behave.feature")
        self.feature.setLevel(loglevel)
        self.scenario = logging.getLogger("behave.scenario")
        self.scenario.setLevel(loglevel)
        self.step = logging.getLogger("behave.step")
        self.step.setLevel(loglevel)
        self.all = logging.getLogger("behave.all")
        self.all.setLevel(loglevel)


def before_all(context):
    """
    :type context: behave.runner.Context
    """

    # Test config

    context.cfg = get_conflagration()