[svn r63808] * refinements/renames to new PluginAPI

* have pytest_runner start to use it, passes the main test

--HG--
branch : trunk
This commit is contained in:
hpk
2009-04-07 22:46:50 +02:00
parent 50664c1e17
commit f14fc582e9
8 changed files with 31 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
import py
import os
from py._com import PyPlugins, MultiCall
from py._com import MultiAPI
from py._com import PluginAPI
pytest_plugins = "xfail"
@@ -254,15 +254,14 @@ class TestMulticallMaker:
def test_happypath(self):
plugins = PyPlugins()
class Api:
def xyz_hello(self, arg):
def hello(self, arg):
pass
mcm = MultiAPI(apiclass=Api, plugins=plugins, prefix="xyz_")
mcm = PluginAPI(apiclass=Api, plugins=plugins)
assert hasattr(mcm, 'hello')
assert repr(mcm.hello).find("xyz_hello") != -1
assert not hasattr(mcm, 'xyz_hello')
assert repr(mcm.hello).find("hello") != -1
class Plugin:
def xyz_hello(self, arg):
def hello(self, arg):
return arg + 1
plugins.register(Plugin())
l = mcm.hello(3)