Exemplo n.º 1
0
    def test_cli_list_roles(self):
        self.appbuilder.sm.add_role('FakeTeamA')
        self.appbuilder.sm.add_role('FakeTeamB')

        with redirect_stdout(io.StringIO()) as stdout:
            role_command.roles_list(self.parser.parse_args(['roles', 'list']))
            stdout = stdout.getvalue()

        self.assertIn('FakeTeamA', stdout)
        self.assertIn('FakeTeamB', stdout)
Exemplo n.º 2
0
    def test_cli_list_roles(self):
        self.appbuilder.sm.add_role('FakeTeamA')
        self.appbuilder.sm.add_role('FakeTeamB')

        with mock.patch('sys.stdout', new_callable=io.StringIO) as mock_stdout:
            role_command.roles_list(self.parser.parse_args(['roles', 'list']))
            stdout = mock_stdout.getvalue()

        self.assertIn('FakeTeamA', stdout)
        self.assertIn('FakeTeamB', stdout)
Exemplo n.º 3
0
 def test_cli_list_roles_with_args(self):
     role_command.roles_list(self.parser.parse_args(['roles', 'list', '--output', 'tsv']))