Esempio n. 1
0
    def test_success(self):
        args = MagicMock()
        stdout = MagicMock()

        logging_setup.configure_logging(args, stdout)
        result = conduct_version.version(args)
        self.assertTrue(result)

        from conductr_cli import __version__
        self.assertEqual(
            strip_margin("""|{}
                            |Supported API version(s): {}
                            |""".format(__version__, ', '.join(conduct_version.supported_api_versions()))),
            self.output(stdout))
    def test_success(self):
        stdout = MagicMock()

        with patch("sys.stdout", stdout):
            conduct_version.version(MagicMock())

        from conductr_cli import __version__

        self.assertEqual(
            strip_margin(
                """|{}
                            |Supported API version(s): {}
                            |""".format(
                    __version__, ", ".join(conduct_version.supported_api_versions())
                )
            ),
            self.output(stdout),
        )
Esempio n. 3
0
def add_api_version(sub_parser):
    sub_parser.add_argument('--api-version',
                            help='Sets which ConductR api version to be used',
                            default=DEFAULT_API_VERSION,
                            dest='api_version',
                            choices=conduct_version.supported_api_versions())
Esempio n. 4
0
def add_api_version(sub_parser):
    sub_parser.add_argument('--api-version',
                            help='Sets which ConductR api version to be used',
                            default=DEFAULT_API_VERSION,
                            dest='api_version',
                            choices=conduct_version.supported_api_versions())