Exemple #1
0
 def handle_plugins(self, type_):
     for fn in plugin.get_plugins('runner'):
         with open(fn) as fobj:
             for line in fobj:
                 yield line
     else:
         yield ''
Exemple #2
0
    def test_get_plugins_pattern(self, plugin_dir):
        create_plugin('init', 'test1', 'FOO = 1\n')
        create_plugin('init', 'test2', 'BAR = 2\n')

        lst = plugin.get_plugins('init', pattern='test2')

        assert lst == ('./init_plugins/test2.py', )
Exemple #3
0
    def test_get_plugins_basedir(self, plugin_dir):
        os.mkdir('subdir')
        create_plugin('subdir/runner', 'test', 'FOO = 1\n')

        lst = plugin.get_plugins('runner', basedir='subdir')

        assert lst == ('subdir/runner_plugins/test.py', )
Exemple #4
0
 def handle_plugins(self, type_):
     for fn in plugin.get_plugins('runner'):
         with open(fn) as fobj:
             for line in fobj:
                 yield line
     else:
         yield ''
    def test_get_plugins_basedir(self, plugin_dir):
        os.mkdir("subdir")
        create_plugin("subdir/runner", "test", "FOO = 1\n")

        lst = plugin.get_plugins("runner", basedir="subdir")

        assert lst == ("subdir/runner_plugins/test.py",)
    def test_get_plugins(self, plugin_dir):
        create_plugin("init", "test1", "FOO = 1\n")
        create_plugin("init", "test2", "BAR = 2\n")

        lst = plugin.get_plugins("init")

        assert lst == ("./init_plugins/test1.py", "./init_plugins/test2.py")