Skip to content

Commit

Permalink
Update default configuration handling
Browse files Browse the repository at this point in the history
Deprecate config-related unit tests
  • Loading branch information
NeonDaniel committed Sep 13, 2024
1 parent f194b80 commit 76ed49b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions neon_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from os import environ
from os.path import join, dirname

environ["OVOS_DEFAULT_CONFIG"] = join(dirname(__file__),
"configuration", "neon.yaml")
14 changes: 7 additions & 7 deletions test/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def setUpClass(cls) -> None:
assert os.path.isfile(os.path.join(cls.CONFIG_PATH,
"OpenVoiceOS", "ovos.conf"))

from ovos_config.meta import get_ovos_config
from neon_core.configuration import Configuration
ovos_config = use_neon_core(get_ovos_config)()
LOG.info(pformat(ovos_config))
assert ovos_config['config_filename'] == 'neon.yaml'
assert os.path.basename(ovos_config['default_config_path']) == "neon.yaml"
assert Configuration.default.path == ovos_config['default_config_path']
# from ovos_config.meta import get_ovos_config
# from neon_core.configuration import Configuration
# ovos_config = use_neon_core(get_ovos_config)()
# LOG.info(pformat(ovos_config))
# assert ovos_config['config_filename'] == 'neon.yaml'
# assert os.path.basename(ovos_config['default_config_path']) == "neon.yaml"
# assert Configuration.default.path == ovos_config['default_config_path']

@classmethod
def tearDownClass(cls) -> None:
Expand Down

0 comments on commit 76ed49b

Please sign in to comment.