def build_script(self, name, extra_args=None): # type: (str, Optional[List[str]]) -> Script try: script = Script.parse(self.parsed_pipfile["scripts"][name]) except KeyError: script = Script(name) if extra_args: script.extend(extra_args) return script
def test_extend(): script = Script('python', ['-c', "print('hello')"]) script.extend(['--verbose']) assert script.command == 'python' assert script.args == ['-c', "print('hello')", "--verbose"], script