Package SmootLight :: Package tests :: Module TestComponentRegistry'
[hide private]
[frames] | no frames]

Source Code for Module SmootLight.tests.TestComponentRegistry'

 1  import unittest 
 2  import util.ComponentRegistry as compReg 
 3  from operationscore.SmootCoreObject import SmootCoreObject  
4 -class TestComponentRegistry(unittest.TestCase):
5 - def setUp(self):
6 compReg.initRegistry()
7
8 - def tearDown(self):
9 compReg.clearRegistry()
10
12 comp = SmootCoreObject({'Id': 'obj1'}) 13 compReg.registerComponent(comp) 14 newcomp = compReg.getComponent('obj1') 15 assert comp == newcomp
16
17 - def test_register_new_id(self):
18 comp = SmootCoreObject({}) 19 cid =compReg.registerComponent(comp) 20 newcomp = compReg.getComponent(cid) 21 assert comp == newcomp
22