Source: python-softlayer Version: 6.2.5-2 Severity: important Tags: ftbfs Dear Maintainer,
To reproduce this locally, you need to install python3-click from experimental on an unstable system or build chroot. Like this: autopkgtest --add-apt-source='deb http://deb.debian.org/debian experimental main' --pin-package=experimental=src:python-click -U . -- unshare -r unstable -t ~/.cache/sbuild/unstable-amd64.tar The full build log is available at https://ci.debian.net/packages/p/python-softlayer/unstable/amd64/72934393/ Relevant part (hopefully): =================================== FAILURES =================================== _________________ DedicatedHostsTests.test_cancel_guests_abort _________________ self = <tests.CLI.modules.dedicatedhost_tests.DedicatedHostsTests testMethod=test_cancel_guests_abort> def test_cancel_guests_abort(self): result = self.run_command(['dedicatedhost', 'cancel-guests', '12345']) > self.assertEqual(result.exit_code, 2) E AssertionError: 1 != 2 tests/CLI/modules/dedicatedhost_tests.py:388: AssertionError __________________ DedicatedHostsTests.test_cancel_host_abort __________________ self = <tests.CLI.modules.dedicatedhost_tests.DedicatedHostsTests testMethod=test_cancel_host_abort> def test_cancel_host_abort(self): result = self.run_command(['dedicatedhost', 'cancel', '12345']) > self.assertEqual(result.exit_code, 2) E AssertionError: 1 != 2 tests/CLI/modules/dedicatedhost_tests.py:359: AssertionError __________________ FileTests.test_file_snapshot_cancel_force ___________________ self = <tests.CLI.modules.file_tests.FileTests testMethod=test_file_snapshot_cancel_force> confirm_mock = <MagicMock name='confirm' id='140113372920336'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_file_snapshot_cancel_force(self, confirm_mock): confirm_mock.return_value = False result = self.run_command(['file', 'snapshot-cancel', '4917309']) > self.assertEqual(2, result.exit_code) E AssertionError: 2 != 1 tests/CLI/modules/file_tests.py:814: AssertionError ___________________ FileTests.test_file_volume_cancel_force ____________________ self = <tests.CLI.modules.file_tests.FileTests testMethod=test_file_volume_cancel_force> confirm_mock = <MagicMock name='confirm' id='140113372919664'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_file_volume_cancel_force(self, confirm_mock): confirm_mock.return_value = False result = self.run_command(['file', 'volume-cancel', '1234']) > self.assertEqual(2, result.exit_code) E AssertionError: 2 != 1 tests/CLI/modules/file_tests.py:821: AssertionError ________________ HardwareCLITests.test_hardware_cancel_no_force ________________ self = <hardware_basic_tests.HardwareCLITests testMethod=test_hardware_cancel_no_force> confirm_mock = <MagicMock name='confirm' id='140113356721520'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_hardware_cancel_no_force(self, confirm_mock): confirm_mock.return_value = False result = self.run_command(['hardware', 'cancel', '102']) > self.assertEqual(2, result.exit_code) E AssertionError: 2 != 1 tests/CLI/modules/hardware/hardware_basic_tests.py:1011: AssertionError _________________________ SubnetTests.test_cancel_fail _________________________ self = <tests.CLI.modules.subnet_tests.SubnetTests testMethod=test_cancel_fail> def test_cancel_fail(self): result = self.run_command(['subnet', 'cancel', '1234']) > self.assertEqual(result.exit_code, 2) E AssertionError: 1 != 2 tests/CLI/modules/subnet_tests.py:186: AssertionError _______________________ VirtCreateTests.test_create_like _______________________ self = <CommandLoader cli> args = ['vs', 'create', '--like=123', '--san', '--billing=hourly'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca150>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: > rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1435: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/click/core.py:1902: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1900: in invoke sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1245: in make_context self.parse_args(ctx, args) /usr/lib/python3/dist-packages/click/core.py:1256: in parse_args _, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result value, source = self.consume_value(ctx, opts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3354: in consume_value value = self.prompt_for_value(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value return prompt( /usr/lib/python3/dist-packages/click/termui.py:179: in prompt value = prompt_func(prompt) ^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'Hostname [vs-test-like]: ' def prompt_func(text: str) -> str: f = hidden_prompt_func if hide_input else visible_prompt_func try: # Write the prompt separately so that we get nice # coloring through colorama on Windows echo(text[:-1], nl=False, err=err) # Echo the last character to stdout to work around an issue where # readline causes backspace to clear the whole line. return f(text[-1:]) except (KeyboardInterrupt, EOFError): # getpass doesn't print a newline if the user aborts input with ^C. # Allegedly this behavior is inherited from getpass(3). # A doc bug has been filed at https://bugs.python.org/issue24711 if hide_input: echo(None, err=err) > raise Abort() from None E click.exceptions.Abort /usr/lib/python3/dist-packages/click/termui.py:162: Abort During handling of the above exception, another exception occurred: self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like> confirm_mock = <MagicMock name='confirm' id='140113450989760'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_create_like(self, confirm_mock): mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject') mock.return_value = { 'hostname': 'vs-test-like', 'domain': 'test.sftlyr.ws', 'maxCpu': 2, 'maxMemory': 1024, 'datacenter': {'name': 'dal05'}, 'networkComponents': [{'maxSpeed': 100}], 'dedicatedAccountHostOnlyFlag': False, 'privateNetworkOnlyFlag': False, 'billingItem': {'orderItem': {'preset': {}}}, 'operatingSystem': {'softwareLicense': { 'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'} }}, 'hourlyBillingFlag': False, 'localDiskFlag': True, 'userData': {} } confirm_mock.return_value = True result = self.run_command(['vs', 'create', '--like=123', '--san', '--billing=hourly']) > self.assert_no_fail(result) tests/CLI/modules/vs/vs_create_tests.py:390: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail raise result.exception /usr/lib/python3/dist-packages/click/testing.py:596: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <CommandLoader cli> args = ['vs', 'create', '--like=123', '--san', '--billing=hourly'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca150>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: rv = self.invoke(ctx) if not standalone_mode: return rv # it's not safe to `ctx.exit(rv)` here! # note that `rv` may actually contain data like "1" which # has obvious effects # more subtle case: `rv=[None, None]` can come out of # chained commands which all returned `None` -- so it's not # even always obvious that `rv` indicates success/failure # by its truthiness/falsiness ctx.exit() except (EOFError, KeyboardInterrupt) as e: echo(file=sys.stderr) raise Abort() from e except ClickException as e: if not standalone_mode: raise e.show() sys.exit(e.exit_code) except OSError as e: if e.errno == errno.EPIPE: sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout)) sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr)) sys.exit(1) else: raise except Exit as e: if standalone_mode: sys.exit(e.exit_code) else: # in non-standalone mode, return the exit code # note that this is only reached if `self.invoke` above raises # an Exit explicitly -- thus bypassing the check there which # would return its result # the results of non-standalone execution may therefore be # somewhat ambiguous: if there are codepaths which lead to # `ctx.exit(1)` and to `return 1`, the caller won't be able to # tell the difference between the two return e.exit_code except Abort: if not standalone_mode: raise echo(_("Aborted!"), file=sys.stderr) > sys.exit(1) E SystemExit: 1 /usr/lib/python3/dist-packages/click/core.py:1478: SystemExit ----------------------------- Captured stdout call ----------------------------- 1 ___________________ VirtCreateTests.test_create_like_flavor ____________________ self = <CommandLoader cli>, args = ['vs', 'create', '--like=123'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca410>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: > rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1435: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/click/core.py:1902: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1900: in invoke sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1245: in make_context self.parse_args(ctx, args) /usr/lib/python3/dist-packages/click/core.py:1256: in parse_args _, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result value, source = self.consume_value(ctx, opts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3354: in consume_value value = self.prompt_for_value(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value return prompt( /usr/lib/python3/dist-packages/click/termui.py:179: in prompt value = prompt_func(prompt) ^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'Hostname [vs-test-like]: ' def prompt_func(text: str) -> str: f = hidden_prompt_func if hide_input else visible_prompt_func try: # Write the prompt separately so that we get nice # coloring through colorama on Windows echo(text[:-1], nl=False, err=err) # Echo the last character to stdout to work around an issue where # readline causes backspace to clear the whole line. return f(text[-1:]) except (KeyboardInterrupt, EOFError): # getpass doesn't print a newline if the user aborts input with ^C. # Allegedly this behavior is inherited from getpass(3). # A doc bug has been filed at https://bugs.python.org/issue24711 if hide_input: echo(None, err=err) > raise Abort() from None E click.exceptions.Abort /usr/lib/python3/dist-packages/click/termui.py:162: Abort During handling of the above exception, another exception occurred: self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_flavor> confirm_mock = <MagicMock name='confirm' id='140113372789264'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_create_like_flavor(self, confirm_mock): mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject') mock.return_value = { 'hostname': 'vs-test-like', 'domain': 'test.sftlyr.ws', 'maxCpu': 2, 'maxMemory': 1024, 'datacenter': {'name': 'dal05'}, 'networkComponents': [{'maxSpeed': 100}], 'dedicatedAccountHostOnlyFlag': False, 'privateNetworkOnlyFlag': False, 'billingItem': {'orderItem': {'preset': {'keyName': 'B1_1X2X25'}}}, 'operatingSystem': {'softwareLicense': { 'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'} }}, 'hourlyBillingFlag': True, 'localDiskFlag': False, 'userData': {} } confirm_mock.return_value = True result = self.run_command(['vs', 'create', '--like=123']) > self.assert_no_fail(result) tests/CLI/modules/vs/vs_create_tests.py:504: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail raise result.exception /usr/lib/python3/dist-packages/click/testing.py:596: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <CommandLoader cli>, args = ['vs', 'create', '--like=123'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca410>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: rv = self.invoke(ctx) if not standalone_mode: return rv # it's not safe to `ctx.exit(rv)` here! # note that `rv` may actually contain data like "1" which # has obvious effects # more subtle case: `rv=[None, None]` can come out of # chained commands which all returned `None` -- so it's not # even always obvious that `rv` indicates success/failure # by its truthiness/falsiness ctx.exit() except (EOFError, KeyboardInterrupt) as e: echo(file=sys.stderr) raise Abort() from e except ClickException as e: if not standalone_mode: raise e.show() sys.exit(e.exit_code) except OSError as e: if e.errno == errno.EPIPE: sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout)) sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr)) sys.exit(1) else: raise except Exit as e: if standalone_mode: sys.exit(e.exit_code) else: # in non-standalone mode, return the exit code # note that this is only reached if `self.invoke` above raises # an Exit explicitly -- thus bypassing the check there which # would return its result # the results of non-standalone execution may therefore be # somewhat ambiguous: if there are codepaths which lead to # `ctx.exit(1)` and to `return 1`, the caller won't be able to # tell the difference between the two return e.exit_code except Abort: if not standalone_mode: raise echo(_("Aborted!"), file=sys.stderr) > sys.exit(1) E SystemExit: 1 /usr/lib/python3/dist-packages/click/core.py:1478: SystemExit ----------------------------- Captured stdout call ----------------------------- 1 ____________________ VirtCreateTests.test_create_like_image ____________________ self = <CommandLoader cli> args = ['vs', 'create', '--like=123', '--san', '--billing=hourly'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca8e0>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: > rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1435: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/click/core.py:1902: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1900: in invoke sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1245: in make_context self.parse_args(ctx, args) /usr/lib/python3/dist-packages/click/core.py:1256: in parse_args _, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result value, source = self.consume_value(ctx, opts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3354: in consume_value value = self.prompt_for_value(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value return prompt( /usr/lib/python3/dist-packages/click/termui.py:179: in prompt value = prompt_func(prompt) ^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'Hostname [vs-test-like]: ' def prompt_func(text: str) -> str: f = hidden_prompt_func if hide_input else visible_prompt_func try: # Write the prompt separately so that we get nice # coloring through colorama on Windows echo(text[:-1], nl=False, err=err) # Echo the last character to stdout to work around an issue where # readline causes backspace to clear the whole line. return f(text[-1:]) except (KeyboardInterrupt, EOFError): # getpass doesn't print a newline if the user aborts input with ^C. # Allegedly this behavior is inherited from getpass(3). # A doc bug has been filed at https://bugs.python.org/issue24711 if hide_input: echo(None, err=err) > raise Abort() from None E click.exceptions.Abort /usr/lib/python3/dist-packages/click/termui.py:162: Abort During handling of the above exception, another exception occurred: self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_image> confirm_mock = <MagicMock name='confirm' id='140113450988752'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_create_like_image(self, confirm_mock): mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject') mock.return_value = { 'hostname': 'vs-test-like', 'domain': 'test.sftlyr.ws', 'maxCpu': 2, 'maxMemory': 1024, 'datacenter': {'name': 'dal05'}, 'networkComponents': [{'maxSpeed': 100}], 'dedicatedAccountHostOnlyFlag': False, 'privateNetworkOnlyFlag': False, 'billingItem': {'orderItem': {'preset': {}}}, 'blockDeviceTemplateGroup': {'globalIdentifier': 'aaa1xxx1122233'}, 'hourlyBillingFlag': False, 'localDiskFlag': True, 'userData': {}, } confirm_mock.return_value = True result = self.run_command(['vs', 'create', '--like=123', '--san', '--billing=hourly']) > self.assert_no_fail(result) tests/CLI/modules/vs/vs_create_tests.py:465: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail raise result.exception /usr/lib/python3/dist-packages/click/testing.py:596: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <CommandLoader cli> args = ['vs', 'create', '--like=123', '--san', '--billing=hourly'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebca8e0>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: rv = self.invoke(ctx) if not standalone_mode: return rv # it's not safe to `ctx.exit(rv)` here! # note that `rv` may actually contain data like "1" which # has obvious effects # more subtle case: `rv=[None, None]` can come out of # chained commands which all returned `None` -- so it's not # even always obvious that `rv` indicates success/failure # by its truthiness/falsiness ctx.exit() except (EOFError, KeyboardInterrupt) as e: echo(file=sys.stderr) raise Abort() from e except ClickException as e: if not standalone_mode: raise e.show() sys.exit(e.exit_code) except OSError as e: if e.errno == errno.EPIPE: sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout)) sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr)) sys.exit(1) else: raise except Exit as e: if standalone_mode: sys.exit(e.exit_code) else: # in non-standalone mode, return the exit code # note that this is only reached if `self.invoke` above raises # an Exit explicitly -- thus bypassing the check there which # would return its result # the results of non-standalone execution may therefore be # somewhat ambiguous: if there are codepaths which lead to # `ctx.exit(1)` and to `return 1`, the caller won't be able to # tell the difference between the two return e.exit_code except Abort: if not standalone_mode: raise echo(_("Aborted!"), file=sys.stderr) > sys.exit(1) E SystemExit: 1 /usr/lib/python3/dist-packages/click/core.py:1478: SystemExit ----------------------------- Captured stdout call ----------------------------- 1 ____________________ VirtCreateTests.test_create_like_tags _____________________ self = <CommandLoader cli> args = ['vs', 'create', '--like=123', '--san', '--billing=hourly'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebcac50>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: > rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1435: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/click/core.py:1902: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1900: in invoke sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1245: in make_context self.parse_args(ctx, args) /usr/lib/python3/dist-packages/click/core.py:1256: in parse_args _, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result value, source = self.consume_value(ctx, opts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3354: in consume_value value = self.prompt_for_value(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value return prompt( /usr/lib/python3/dist-packages/click/termui.py:179: in prompt value = prompt_func(prompt) ^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'Hostname [vs-test-like]: ' def prompt_func(text: str) -> str: f = hidden_prompt_func if hide_input else visible_prompt_func try: # Write the prompt separately so that we get nice # coloring through colorama on Windows echo(text[:-1], nl=False, err=err) # Echo the last character to stdout to work around an issue where # readline causes backspace to clear the whole line. return f(text[-1:]) except (KeyboardInterrupt, EOFError): # getpass doesn't print a newline if the user aborts input with ^C. # Allegedly this behavior is inherited from getpass(3). # A doc bug has been filed at https://bugs.python.org/issue24711 if hide_input: echo(None, err=err) > raise Abort() from None E click.exceptions.Abort /usr/lib/python3/dist-packages/click/termui.py:162: Abort During handling of the above exception, another exception occurred: self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_tags> confirm_mock = <MagicMock name='confirm' id='140113372918656'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_create_like_tags(self, confirm_mock): mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject') mock.return_value = { 'hostname': 'vs-test-like', 'domain': 'test.sftlyr.ws', 'maxCpu': 2, 'maxMemory': 1024, 'datacenter': {'name': 'dal05'}, 'networkComponents': [{'maxSpeed': 100}], 'dedicatedAccountHostOnlyFlag': False, 'privateNetworkOnlyFlag': False, 'billingItem': {'orderItem': {'preset': {}}}, 'operatingSystem': {'softwareLicense': { 'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'} }}, 'hourlyBillingFlag': False, 'localDiskFlag': True, 'userData': {}, 'tagReferences': [{'tag': {'name': 'production'}}], } confirm_mock.return_value = True result = self.run_command(['vs', 'create', '--like=123', '--san', '--billing=hourly']) > self.assert_no_fail(result) tests/CLI/modules/vs/vs_create_tests.py:434: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail raise result.exception /usr/lib/python3/dist-packages/click/testing.py:596: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <CommandLoader cli> args = ['vs', 'create', '--like=123', '--san', '--billing=hourly'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebcac50>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: rv = self.invoke(ctx) if not standalone_mode: return rv # it's not safe to `ctx.exit(rv)` here! # note that `rv` may actually contain data like "1" which # has obvious effects # more subtle case: `rv=[None, None]` can come out of # chained commands which all returned `None` -- so it's not # even always obvious that `rv` indicates success/failure # by its truthiness/falsiness ctx.exit() except (EOFError, KeyboardInterrupt) as e: echo(file=sys.stderr) raise Abort() from e except ClickException as e: if not standalone_mode: raise e.show() sys.exit(e.exit_code) except OSError as e: if e.errno == errno.EPIPE: sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout)) sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr)) sys.exit(1) else: raise except Exit as e: if standalone_mode: sys.exit(e.exit_code) else: # in non-standalone mode, return the exit code # note that this is only reached if `self.invoke` above raises # an Exit explicitly -- thus bypassing the check there which # would return its result # the results of non-standalone execution may therefore be # somewhat ambiguous: if there are codepaths which lead to # `ctx.exit(1)` and to `return 1`, the caller won't be able to # tell the difference between the two return e.exit_code except Abort: if not standalone_mode: raise echo(_("Aborted!"), file=sys.stderr) > sys.exit(1) E SystemExit: 1 /usr/lib/python3/dist-packages/click/core.py:1478: SystemExit ----------------------------- Captured stdout call ----------------------------- 1 __________________ VirtCreateTests.test_create_like_transient __________________ self = <CommandLoader cli>, args = ['vs', 'create', '--like=123'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebcaf10>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: > rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1435: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/click/core.py:1902: in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1900: in invoke sub_ctx = cmd.make_context(cmd_name, args, parent=ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:1245: in make_context self.parse_args(ctx, args) /usr/lib/python3/dist-packages/click/core.py:1256: in parse_args _, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:2583: in handle_parse_result value, source = self.consume_value(ctx, opts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3354: in consume_value value = self.prompt_for_value(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^ /usr/lib/python3/dist-packages/click/core.py:3215: in prompt_for_value return prompt( /usr/lib/python3/dist-packages/click/termui.py:179: in prompt value = prompt_func(prompt) ^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ text = 'Hostname [vs-test-like]: ' def prompt_func(text: str) -> str: f = hidden_prompt_func if hide_input else visible_prompt_func try: # Write the prompt separately so that we get nice # coloring through colorama on Windows echo(text[:-1], nl=False, err=err) # Echo the last character to stdout to work around an issue where # readline causes backspace to clear the whole line. return f(text[-1:]) except (KeyboardInterrupt, EOFError): # getpass doesn't print a newline if the user aborts input with ^C. # Allegedly this behavior is inherited from getpass(3). # A doc bug has been filed at https://bugs.python.org/issue24711 if hide_input: echo(None, err=err) > raise Abort() from None E click.exceptions.Abort /usr/lib/python3/dist-packages/click/termui.py:162: Abort During handling of the above exception, another exception occurred: self = <tests.CLI.modules.vs.vs_create_tests.VirtCreateTests testMethod=test_create_like_transient> confirm_mock = <MagicMock name='confirm' id='140113450990096'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_create_like_transient(self, confirm_mock): mock = self.set_mock('SoftLayer_Virtual_Guest', 'getObject') mock.return_value = { 'hostname': 'vs-test-like', 'domain': 'test.sftlyr.ws', 'datacenter': {'name': 'dal05'}, 'networkComponents': [{'maxSpeed': 100}], 'dedicatedAccountHostOnlyFlag': False, 'privateNetworkOnlyFlag': False, 'billingItem': {'orderItem': {'preset': {'keyName': 'B1_1X2X25'}}}, 'operatingSystem': {'softwareLicense': { 'softwareDescription': {'referenceCode': 'UBUNTU_LATEST'} }}, 'hourlyBillingFlag': True, 'localDiskFlag': False, 'transientGuestFlag': True, 'userData': {} } confirm_mock.return_value = True result = self.run_command(['vs', 'create', '--like=123']) > self.assert_no_fail(result) tests/CLI/modules/vs/vs_create_tests.py:545: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/SoftLayer/testing/__init__.py:159: in assert_no_fail raise result.exception /usr/lib/python3/dist-packages/click/testing.py:596: in invoke return_value = cli.main(args=args or (), prog_name=prog_name, **extra) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <CommandLoader cli>, args = ['vs', 'create', '--like=123'] prog_name = 'cli', complete_var = None, standalone_mode = True windows_expand_args = True extra = {'obj': <SoftLayer.CLI.environment.Environment object at 0x7f6eaebcaf10>} def main( self, args: cabc.Sequence[str] | None = None, prog_name: str | None = None, complete_var: str | None = None, standalone_mode: bool = True, windows_expand_args: bool = True, **extra: t.Any, ) -> t.Any: """This is the way to invoke a script with all the bells and whistles as a command line application. This will always terminate the application after a call. If this is not wanted, ``SystemExit`` needs to be caught. This method is also available by directly calling the instance of a :class:`Command`. :param args: the arguments that should be used for parsing. If not provided, ``sys.argv[1:]`` is used. :param prog_name: the program name that should be used. By default the program name is constructed by taking the file name from ``sys.argv[0]``. :param complete_var: the environment variable that controls the bash completion support. The default is ``"_<prog_name>_COMPLETE"`` with prog_name in uppercase. :param standalone_mode: the default behavior is to invoke the script in standalone mode. Click will then handle exceptions and convert them into error messages and the function will never return but shut down the interpreter. If this is set to `False` they will be propagated to the caller and the return value of this function is the return value of :meth:`invoke`. :param windows_expand_args: Expand glob patterns, user dir, and env vars in command line args on Windows. :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. .. versionchanged:: 8.0.1 Added the ``windows_expand_args`` parameter to allow disabling command line arg expansion on Windows. .. versionchanged:: 8.0 When taking arguments from ``sys.argv`` on Windows, glob patterns, user dir, and env vars are expanded. .. versionchanged:: 3.0 Added the ``standalone_mode`` parameter. """ if args is None: args = sys.argv[1:] if os.name == "nt" and windows_expand_args: args = _expand_args(args) else: args = list(args) if prog_name is None: prog_name = _detect_program_name() # Process shell completion requests and exit early. self._main_shell_completion(extra, prog_name, complete_var) try: try: with self.make_context(prog_name, args, **extra) as ctx: rv = self.invoke(ctx) if not standalone_mode: return rv # it's not safe to `ctx.exit(rv)` here! # note that `rv` may actually contain data like "1" which # has obvious effects # more subtle case: `rv=[None, None]` can come out of # chained commands which all returned `None` -- so it's not # even always obvious that `rv` indicates success/failure # by its truthiness/falsiness ctx.exit() except (EOFError, KeyboardInterrupt) as e: echo(file=sys.stderr) raise Abort() from e except ClickException as e: if not standalone_mode: raise e.show() sys.exit(e.exit_code) except OSError as e: if e.errno == errno.EPIPE: sys.stdout = t.cast(t.TextIO, PacifyFlushWrapper(sys.stdout)) sys.stderr = t.cast(t.TextIO, PacifyFlushWrapper(sys.stderr)) sys.exit(1) else: raise except Exit as e: if standalone_mode: sys.exit(e.exit_code) else: # in non-standalone mode, return the exit code # note that this is only reached if `self.invoke` above raises # an Exit explicitly -- thus bypassing the check there which # would return its result # the results of non-standalone execution may therefore be # somewhat ambiguous: if there are codepaths which lead to # `ctx.exit(1)` and to `return 1`, the caller won't be able to # tell the difference between the two return e.exit_code except Abort: if not standalone_mode: raise echo(_("Aborted!"), file=sys.stderr) > sys.exit(1) E SystemExit: 1 /usr/lib/python3/dist-packages/click/core.py:1478: SystemExit ----------------------------- Captured stdout call ----------------------------- 1 ___________________ BlockTests.test_snapshot_cancel_no_force ___________________ self = <tests.managers.block_tests.BlockTests testMethod=test_snapshot_cancel_no_force> confirm_mock = <MagicMock name='confirm' id='140113522550032'> @mock.patch('SoftLayer.CLI.formatting.confirm') def test_snapshot_cancel_no_force(self, confirm_mock): confirm_mock.return_value = False result = self.run_command(['block', 'snapshot-cancel', '102']) > self.assertEqual(2, result.exit_code) E AssertionError: 2 != 1 tests/managers/block_tests.py:290: AssertionError =============================== warnings summary =============================== tests/CLI/core_tests.py::CoreTests::test_build_client tests/CLI/core_tests.py::CoreTests::test_diagnostics tests/CLI/core_tests.py::CoreTests::test_load_all tests/CLI/core_tests.py::CoreTests::test_verbose_max tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_args tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs_domain /usr/lib/python3/dist-packages/click/core.py:1252: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique. parser = self.make_parser(ctx) tests/CLI/core_tests.py::CoreTests::test_build_client tests/CLI/core_tests.py::CoreTests::test_diagnostics tests/CLI/core_tests.py::CoreTests::test_load_all tests/CLI/core_tests.py::CoreTests::test_verbose_max tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_args tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs tests/CLI/modules/vs/vs_tests.py::VirtTests::test_list_vs_search_noargs_domain /usr/lib/python3/dist-packages/click/core.py:1245: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique. self.parse_args(ctx, args) tests/CLI/core_tests.py::CoreTests::test_load_all /usr/lib/python3/dist-packages/SoftLayer/CLI/command.py:177: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique. pieces = self.collect_usage_pieces(ctx) tests/CLI/core_tests.py::CoreTests::test_load_all /usr/lib/python3/dist-packages/click/core.py:1163: UserWarning: The parameter --tag is used more than once. Remove its duplicate as parameters should be unique. self.format_options(ctx, formatter) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED tests/CLI/modules/dedicatedhost_tests.py::DedicatedHostsTests::test_cancel_guests_abort FAILED tests/CLI/modules/dedicatedhost_tests.py::DedicatedHostsTests::test_cancel_host_abort FAILED tests/CLI/modules/file_tests.py::FileTests::test_file_snapshot_cancel_force FAILED tests/CLI/modules/file_tests.py::FileTests::test_file_volume_cancel_force FAILED tests/CLI/modules/hardware/hardware_basic_tests.py::HardwareCLITests::test_hardware_cancel_no_force FAILED tests/CLI/modules/subnet_tests.py::SubnetTests::test_cancel_fail - Ass... FAILED tests/CLI/modules/vs/vs_create_tests.py::VirtCreateTests::test_create_like FAILED tests/CLI/modules/vs/vs_create_tests.py::VirtCreateTests::test_create_like_flavor FAILED tests/CLI/modules/vs/vs_create_tests.py::VirtCreateTests::test_create_like_image FAILED tests/CLI/modules/vs/vs_create_tests.py::VirtCreateTests::test_create_like_tags FAILED tests/CLI/modules/vs/vs_create_tests.py::VirtCreateTests::test_create_like_transient FAILED tests/managers/block_tests.py::BlockTests::test_snapshot_cancel_no_force =========== 12 failed, 2022 passed, 6 skipped, 18 warnings in 22.61s =========== autopkgtest [16:28:26]: test py3: -----------------------] autopkgtest [16:28:27]: test py3: - - - - - - - - - - results - - - - - - - - - - py3 FAIL non-zero exit status 1 autopkgtest [16:28:27]: @@@@@@@@@@@@@@@@@@@@ summary py3 FAIL non-zero exit status 1
signature.asc
Description: PGP signature

