Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jan 11, 2025
1 parent 10ee91c commit e9cd75b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
12 changes: 0 additions & 12 deletions test/unittests/config_stack/remote.yaml

This file was deleted.

9 changes: 3 additions & 6 deletions test/unittests/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def tearDownClass(cls) -> None:

def tearDown(self):
from ovos_config.config import Configuration
Configuration.load_config_stack([{}], True)
Configuration.load_config_stack([{}])
Configuration._callbacks = []

@patch('json.dump')
Expand Down Expand Up @@ -132,11 +132,9 @@ def test_load_config_stack(self):
test_dir = join(dirname(__file__), "config_stack")
default_config = LocalConf(join(test_dir, "default.yaml"))
system_config = LocalConf(join(test_dir, "system.yaml"))
remote_config = LocalConf(join(test_dir, "remote.yaml"))
user_config = LocalConf(join(test_dir, "user.yaml"))
Configuration.default = default_config
Configuration.system = system_config
Configuration.remote = remote_config
Configuration.xdg_configs = [user_config]
Configuration.__patch = LocalConf(None)
Configuration._old_user = LocalConf(None)
Expand All @@ -150,18 +148,17 @@ def test_load_config_stack(self):
"from_usr": False})
# Test default constraints (overridden)
self.assertEqual(config["default_spec"], {"from_sys": True,
"from_rem": True,
"from_rem": False,
"from_usr": True})
# Test nested constraints
self.assertEqual(config["test"], {"default": True,
"system": True,
"user": True,
"remote": True})
"remote": False})
# Test non-overridden default config
self.assertEqual(config["default_only"], "default")
# Test protected key is undefined
self.assertFalse("user_only" in config)
self.assertEqual(config["remote_only"], "remote")

def test_config_patches_filewatch(self):
event = Event()
Expand Down

0 comments on commit e9cd75b

Please sign in to comment.