parent
de4c2dc98d
commit
f0a277008a
|
@ -90,9 +90,7 @@ class Registry:
|
||||||
l = []
|
l = []
|
||||||
if plugins is None:
|
if plugins is None:
|
||||||
plugins = self._plugins
|
plugins = self._plugins
|
||||||
if extra:
|
for plugin in list(plugins) + list(extra):
|
||||||
plugins += list(extra)
|
|
||||||
for plugin in plugins:
|
|
||||||
try:
|
try:
|
||||||
l.append(getattr(plugin, attrname))
|
l.append(getattr(plugin, attrname))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
|
@ -135,6 +135,12 @@ class TestRegistry:
|
||||||
l = list(plugins.listattr('x', reverse=True))
|
l = list(plugins.listattr('x', reverse=True))
|
||||||
assert l == [43, 42, 41]
|
assert l == [43, 42, 41]
|
||||||
|
|
||||||
|
class api4:
|
||||||
|
x = 44
|
||||||
|
l = list(plugins.listattr('x', extra=(api4,)))
|
||||||
|
assert l == range(41, 45)
|
||||||
|
assert len(list(plugins)) == 3 # otherwise extra added
|
||||||
|
|
||||||
def test_api_and_defaults():
|
def test_api_and_defaults():
|
||||||
assert isinstance(py._com.comregistry, Registry)
|
assert isinstance(py._com.comregistry, Registry)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue