예제 #1
0
파일: __init__.py 프로젝트: AnyBlok/AnyBlok
    def unregister(self, entry, cls_):
        """ Remove the Interface from the registry

        :param entry: entry declaration of the model where the ``cls_``
            must be removed
        :param cls_: Class Interface to remove in registry
        """
        RegistryManager.remove_in_register(cls_)
예제 #2
0
    def unregister(self, entry, cls_):
        """ Remove the Interface from the registry

        :param entry: entry declaration of the model where the ``cls_``
            must be removed
        :param cls_: Class Interface to remove in the declaration
        """
        RegistryManager.remove_in_register(cls_)
예제 #3
0
    def test_remove_entry(self):
        class test:
            pass

        def has_test_in_removed():
            core = RegistryManager.loaded_bloks['testEntry']['removed']
            if test in core:
                return True

            return False

        RegistryManager.add_entry_in_register('Other', 'test', test)
        self.assertInEntry('test', test)
        self.assertFalse(has_test_in_removed())
        RegistryManager.remove_in_register(test)
        self.assertTrue(has_test_in_removed())
예제 #4
0
    def test_remove_core(self):
        class test:
            pass

        def has_test_in_removed():
            core = RegistryManager.loaded_bloks['testCore']['removed']
            if test in core:
                return True

            return False

        RegistryManager.add_core_in_register('test', test)
        self.assertInCore(test)
        self.assertEqual(has_test_in_removed(), False)
        RegistryManager.remove_in_register(test)
        self.assertEqual(has_test_in_removed(), True)
예제 #5
0
    def test_remove_core(self):
        class test:
            pass

        def has_test_in_removed():
            core = RegistryManager.loaded_bloks['testCore']['removed']
            if test in core:
                return True

            return False

        RegistryManager.add_core_in_register('test', test)
        self.assertInCore(test)
        assert not has_test_in_removed()
        RegistryManager.remove_in_register(test)
        assert has_test_in_removed()