Exemplo n.º 1
0
    def test_show_mask(self, m_get_plugin_opts):
        arglist = ['--mask']
        verifylist = [('mask', True)]
        cmd = configuration.ShowConfiguration(self.app, None)
        parsed_args = self.check_parser(cmd, arglist, verifylist)

        columns, data = cmd.take_action(parsed_args)

        self.assertEqual(self.columns, columns)
        self.assertEqual(self.datalist, data)
Exemplo n.º 2
0
    def test_show_unmask(self, m_get_plugin_opts):
        arglist = ['--unmask']
        verifylist = [('mask', False)]
        cmd = configuration.ShowConfiguration(self.app, None)
        parsed_args = self.check_parser(cmd, arglist, verifylist)

        columns, data = cmd.take_action(parsed_args)

        self.assertEqual(self.columns, columns)
        datalist = (
            fakes.PASSWORD,
            fakes.AUTH_TOKEN,
            fakes.USERNAME,
            fakes.VERSION,
            fakes.REGION_NAME,
        )
        self.assertEqual(datalist, data)
    def test_show_mask(self):
        arglist = ['--mask']
        verifylist = [('mask', True)]
        cmd = configuration.ShowConfiguration(self.app, None)
        parsed_args = self.check_parser(cmd, arglist, verifylist)

        columns, data = cmd.take_action(parsed_args)

        collist = ('auth.password', 'auth.token', 'auth.username',
                   'identity_api_version', 'region')
        self.assertEqual(collist, columns)
        datalist = (
            configuration.REDACTED,
            configuration.REDACTED,
            fakes.USERNAME,
            fakes.VERSION,
            fakes.REGION_NAME,
        )
        self.assertEqual(datalist, tuple(data))