diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-06-11 14:51:25 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-06-18 09:45:00 +0000 |
commit | d139abbc8cb322ab1249b4ae7b23f86e20d4eb93 (patch) | |
tree | 5195073968340b24a2fe11644912555e9271e984 /src/buildstream/testing | |
parent | e55a89bffad51955c6c245eac5df98d025b586b9 (diff) | |
download | buildstream-d139abbc8cb322ab1249b4ae7b23f86e20d4eb93.tar.gz |
CliIntegration: match methods to base class
Update 'run' to match the base class. This ensures that it is a fully
substitutable sub-class.
Introduce 'run_project_config' to allow explicit usage of extended
functionality, which wouldn't necessarily be supported by a different
subclass.
By making the signatures deliberately match, we can use PyLint to ensure
the signatures don't accidentally differ.
Since we're already relying on `kwargs['project']` succeeding, enforce
that run_project_config() only takes keyword arguments.
Diffstat (limited to 'src/buildstream/testing')
-rw-r--r-- | src/buildstream/testing/runcli.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/buildstream/testing/runcli.py b/src/buildstream/testing/runcli.py index 8b3185143..9efff4593 100644 --- a/src/buildstream/testing/runcli.py +++ b/src/buildstream/testing/runcli.py @@ -513,6 +513,16 @@ class CliIntegration(Cli): # run() # + # This supports the same arguments as Cli.run(), see run_project_config(). + # + def run(self, configure=True, project=None, silent=False, env=None, + cwd=None, options=None, args=None, binary_capture=False): + return self.run_project_config( + configure=configure, project=project, silent=silent, env=env, + cwd=cwd, options=options, args=args, binary_capture=binary_capture) + + # run_project_config() + # # This supports the same arguments as Cli.run() and additionally # it supports the project_config keyword argument. # @@ -524,7 +534,7 @@ class CliIntegration(Cli): # be a dictionary of additional project configuration options, and # will be composited on top of the already loaded project.conf # - def run(self, *args, project_config=None, **kwargs): + def run_project_config(self, *, project_config=None, **kwargs): # First load the project.conf and substitute {project_dir} # @@ -575,7 +585,7 @@ class CliIntegration(Cli): with open(project_filename, 'w') as f: f.write(config) - return super().run(*args, **kwargs) + return super().run(**kwargs) class CliRemote(CliIntegration): |