forked from eclipse-ecal/ecal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbe45d1
commit 4f7101b
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
lang/python/nanobind_core/tests/config_files_test/application_config_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import unittest | ||
import nanobind_core as ecal_module | ||
|
||
class TestApplicationConfiguration(unittest.TestCase): | ||
|
||
def setUp(self): | ||
"""Set up the application configuration object for testing.""" | ||
self.app_config = ecal_module.ApplicationConfiguration() | ||
|
||
def test_default_initialization(self): | ||
"""Test that the default values are correctly initialized.""" | ||
# Test Sys::Configuration | ||
self.assertIsInstance(self.app_config.sys, ecal_module.SysConfiguration) | ||
self.assertEqual(self.app_config.sys.filter_excl, "^eCALSysClient$|^eCALSysGUI$|^eCALSys$") | ||
|
||
# Test Startup::Configuration | ||
self.assertIsInstance(self.app_config.startup, ecal_module.StartupConfiguration) | ||
self.assertEqual(self.app_config.startup.terminal_emulator, "") | ||
|
||
def test_modify_sys_configuration(self): | ||
"""Test modifying the Sys::Configuration.""" | ||
self.app_config.sys.filter_excl = "^MyApp$|^AnotherApp$" | ||
self.assertEqual(self.app_config.sys.filter_excl, "^MyApp$|^AnotherApp$") | ||
|
||
def test_modify_startup_configuration(self): | ||
"""Test modifying the Startup::Configuration.""" | ||
self.app_config.startup.terminal_emulator = "gnome-terminal" | ||
self.assertEqual(self.app_config.startup.terminal_emulator, "gnome-terminal") | ||
|
||
def test_nested_initialization(self): | ||
"""Ensure nested configurations remain accessible.""" | ||
sys_config = self.app_config.sys | ||
startup_config = self.app_config.startup | ||
self.assertIsInstance(sys_config, ecal_module.SysConfiguration) | ||
self.assertIsInstance(startup_config, ecal_module.StartupConfiguration) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |