Ejemplo n.º 1
0
 def test_global_property(self):
     RegistryManager.declare_entry('Other')
     blok = 'newblok'
     RegistryManager.init_blok(blok)
     try:
         oldblok = EnvironmentManager.get('current_blok')
         EnvironmentManager.set('current_blok', blok)
         assert not RegistryManager.has_blok_property('myproperty')
         RegistryManager.add_or_replace_blok_property('myproperty', 2)
         assert RegistryManager.has_blok_property('myproperty')
         assert RegistryManager.get_blok_property('myproperty') == 2
         RegistryManager.add_or_replace_blok_property('myproperty', 3)
         assert RegistryManager.get_blok_property('myproperty') == 3
         RegistryManager.remove_blok_property('myproperty')
         assert not RegistryManager.has_blok_property('myproperty')
     finally:
         EnvironmentManager.set('current_blok', oldblok)
Ejemplo n.º 2
0
 def test_global_property(self):
     RegistryManager.declare_entry('Other')
     blok = 'newblok'
     RegistryManager.init_blok(blok)
     try:
         oldblok = EnvironmentManager.get('current_blok')
         EnvironmentManager.set('current_blok', blok)
         self.assertEqual(RegistryManager.has_blok_property('myproperty'),
                          False)
         RegistryManager.add_or_replace_blok_property('myproperty', 2)
         self.assertEqual(RegistryManager.has_blok_property('myproperty'),
                          True)
         self.assertEqual(RegistryManager.get_blok_property('myproperty'),
                          2)
         RegistryManager.add_or_replace_blok_property('myproperty', 3)
         self.assertEqual(RegistryManager.get_blok_property('myproperty'),
                          3)
         RegistryManager.remove_blok_property('myproperty')
         self.assertEqual(RegistryManager.has_blok_property('myproperty'),
                          False)
     finally:
         EnvironmentManager.set('current_blok', oldblok)
Ejemplo n.º 3
0
 def test_global_property(self):
     RegistryManager.declare_entry('Other')
     blok = 'newblok'
     RegistryManager.init_blok(blok)
     try:
         oldblok = EnvironmentManager.get('current_blok')
         EnvironmentManager.set('current_blok', blok)
         self.assertEqual(RegistryManager.has_blok_property('myproperty'),
                          False)
         RegistryManager.add_or_replace_blok_property('myproperty', 2)
         self.assertEqual(
             RegistryManager.has_blok_property('myproperty'), True)
         self.assertEqual(
             RegistryManager.get_blok_property('myproperty'), 2)
         RegistryManager.add_or_replace_blok_property('myproperty', 3)
         self.assertEqual(
             RegistryManager.get_blok_property('myproperty'), 3)
         RegistryManager.remove_blok_property('myproperty')
         self.assertEqual(RegistryManager.has_blok_property('myproperty'),
                          False)
     finally:
         EnvironmentManager.set('current_blok', oldblok)