diff options
author | Russell Cohen <rcoh@mit.edu> | 2011-01-10 23:24:02 -0500 |
---|---|---|
committer | Russell Cohen <rcoh@mit.edu> | 2011-01-10 23:24:02 -0500 |
commit | aaf8bdbee7fdc1d4721f43307fc824c373c69ec4 (patch) | |
tree | ee22f0ac45dede7fa8263cfc91f2730b19d07da9 /tests | |
parent | a1969e4c4bf61bc6e73c6a59fbef96e8ce361611 (diff) |
some improvements to behavior chain. A "Square" Behavior
Diffstat (limited to 'tests')
-rw-r--r-- | tests/TestComponentRegistry.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/TestComponentRegistry.py b/tests/TestComponentRegistry.py index 1acd0c8..5ada524 100644 --- a/tests/TestComponentRegistry.py +++ b/tests/TestComponentRegistry.py @@ -1,11 +1,19 @@ import unittest import util.ComponentRegistry as compReg +from operationscore.SmootCoreObject import SmootCoreObject class TestComponentRegistry(unittest.TestCase): def setUp(self): compReg.initRegistry() def tearDown(self): compReg.clearRegistry() - def test_register_component(self): - comp = SmootCoreObject({'Id': obj1}) + def test_register_component_id_specified(self): + comp = SmootCoreObject({'Id': 'obj1'}) compReg.registerComponent(comp) + newcomp = compReg.getComponent('obj1') + assert comp == newcomp + def test_register_new_id(self): + comp = SmootCoreObject({}) + cid =compReg.registerComponent(comp) + newcomp = compReg.getComponent(cid) + assert comp == newcomp |