def test_load_anyblok(self): BlokManager.load() if not BlokManager.list(): self.fail('No blok load') if not BlokManager.has('anyblok-core'): self.fail("The blok 'anyblok-core' is missing") BlokManager.get('anyblok-core')
def test_load_anyblok(self): BlokManager.load() if not BlokManager.list(): self.fail('No blok load') if not BlokManager.has('anyblok-core'): self.fail("The blok 'anyblok-core' is missing") BlokManager.get('anyblok-core')
def add(cls, blok): """ Store the blok so that we know which bloks to reload if needed :param blok: name of the blok to add :rtype: loader instance :exception: ImportManagerException """ from anyblok.blok import BlokManager if cls.has(blok): return cls.get(blok) if not BlokManager.has(blok): raise ImportManagerException("Unexisting blok") loader = Loader(blok) cls.modules[blok] = loader return loader
def add(cls, blok): """ Store the blok so that we know which bloks to reload if needed :param blok: name of the blok to add :rtype: loader instance :exception: ImportManagerException """ from anyblok.blok import BlokManager if cls.has(blok): return cls.get(blok) if not BlokManager.has(blok): raise ImportManagerException("Unexisting blok") loader = Loader(blok) cls.modules[blok] = loader return loader
def test_set(self): blok_name = 'ABlok' BlokManager.set(blok_name, Blok) self.assertEqual(BlokManager.has(blok_name), True)
def test_set(self): blok_name = 'ABlok' BlokManager.set(blok_name, Blok) self.assertTrue(BlokManager.has(blok_name))
def exist(self): return BlokManager.has(self.blok.name)
def exist(self): return BlokManager.has(self.blok.name)
def test_set(self): blok_name = 'ABlok' BlokManager.set(blok_name, Blok) assert BlokManager.has(blok_name)