Public Access
- raise instead of silent None for unsupported operands and empty negation - validate before acquiring lock in Accumulation operators (no RLock leak) - Accumulation._copy_provenance helper, ADC_Result._copy_metadata for all result paths - shared _sandbox_stdout_redirect contextmanager for sandboxed scripts - TemperatureMonitor dead code removal (gtk helper, traceback, unused properties) - new unit tests incl. lock-freedom regression test - gitignore sphinx generated doc/_autosummary/ and doc/damaris/
30 lines
935 B
Python
30 lines
935 B
Python
import unittest
|
|
|
|
from damaris.data.Config_Result import Config_Result
|
|
|
|
|
|
class TestConfigResult(unittest.TestCase):
|
|
def test_constructor_with_no_arguments(self):
|
|
"""Test initializer with no arguments."""
|
|
cr = Config_Result()
|
|
self.assertEqual(cr.get_config_dictionary(), {})
|
|
self.assertEqual(cr.description, {})
|
|
|
|
def test_constructor_with_arguments(self):
|
|
"""Test initializer with config and description arguments."""
|
|
config = {"a": 1}
|
|
desc = {"b": 2}
|
|
cr = Config_Result(config=config, desc=desc)
|
|
self.assertEqual(cr.get_config_dictionary(), config)
|
|
self.assertEqual(cr.description, desc)
|
|
|
|
def test_get_set_config(self):
|
|
cr = Config_Result()
|
|
cr.set_config("key", "value")
|
|
self.assertEqual(cr.get_config("key"), "value")
|
|
self.assertIsNone(cr.get_config("missing"))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|