def test_cluster_status_by_unauthorized_user(self): self.use_manager() with mock.patch.object(self.client.cluster_status, 'get_status') as status: status.side_effect = UserUnauthorizedError('Unauthorized user') outcome = self.invoke('cfy cluster status') self.assertIn('User is unauthorized', outcome.logs)
def test_use_attempt_by_unauthorized_user(self): with patch.object(self.client.manager, 'get_status') as mock: mock.side_effect = UserUnauthorizedError('Unauthorized user') self._assert_ex('cfy use -t 127.0.0.1', err_str_segment='User is unauthorized')
def test_use_attempt_by_unauthorized_user(self): with patch.object(self.client.manager, 'get_status') as mock: mock.side_effect = UserUnauthorizedError('Unauthorized user') self.invoke('cfy profiles use 127.0.0.1', err_str_segment='Unauthorized user')
def test_status_by_unauthorized_user(self): with patch('cloudify_cli.utils.get_management_server_ip'): with patch.object(self.client.manager, 'get_status') as mock: mock.side_effect = UserUnauthorizedError('Unauthorized user') output = cli_runner.run_cli('cfy status') self.assertIn('User is unauthorized', output)