Exemplo n.º 1
0
    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')
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
 def test_set(self):
     blok_name = 'ABlok'
     BlokManager.set(blok_name, Blok)
     self.assertEqual(BlokManager.has(blok_name), True)
Exemplo n.º 6
0
 def test_set(self):
     blok_name = 'ABlok'
     BlokManager.set(blok_name, Blok)
     self.assertTrue(BlokManager.has(blok_name))
Exemplo n.º 7
0
 def exist(self):
     return BlokManager.has(self.blok.name)
Exemplo n.º 8
0
 def exist(self):
     return BlokManager.has(self.blok.name)
Exemplo n.º 9
0
 def test_set(self):
     blok_name = 'ABlok'
     BlokManager.set(blok_name, Blok)
     assert BlokManager.has(blok_name)