コード例 #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
ファイル: test_registry_core.py プロジェクト: AnyBlok/AnyBlok
    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()