mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 03:22:39 +01:00
add a lib keyword arg to the run_command test helper
Now a `Library` instance can be passed to run_command as a keyword argument.
This commit is contained in:
parent
7bb649c3b2
commit
9ab9166c8d
1 changed files with 7 additions and 1 deletions
|
|
@ -421,10 +421,16 @@ class TestHelper(object):
|
|||
|
||||
# Running beets commands
|
||||
|
||||
def run_command(self, *args):
|
||||
def run_command(self, *args, **kwargs):
|
||||
"""Run a beets command with an arbitrary amount of arguments. The
|
||||
Library` defaults to `self.lib`, but can be overridden with
|
||||
the keyword argument `lib`.
|
||||
"""
|
||||
sys.argv = ['beet'] # avoid leakage from test suite args
|
||||
lib = None
|
||||
if hasattr(self, 'lib'):
|
||||
lib = self.lib
|
||||
lib = kwargs.get('lib', lib)
|
||||
beets.ui._raw_main(list(args), lib)
|
||||
|
||||
def run_with_output(self, *args):
|
||||
|
|
|
|||
Loading…
Reference in a new issue