File: recorded_test_case.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (23 lines) | stat: -rw-r--r-- 800 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os

from devtools_testutils import AzureRecordedTestCase, is_live
import pytest

PLAYBACK_CLIENT_ID = "client-id"


class RecordedTestCase(AzureRecordedTestCase):
    @pytest.fixture()
    def user_assigned_identity_client_id(self):
        self.user_assigned_identity_client_id = os.environ.get("USER_ASSIGNED_IDENTITY_CLIENT_ID", PLAYBACK_CLIENT_ID)
        if is_live():
            if self.user_assigned_identity_client_id == PLAYBACK_CLIENT_ID:
                pytest.skip("Set a value for $USER_ASSIGNED_IDENTITY_CLIENT_ID to record this test")

    @property
    def scope(self):
        return "https://management.azure.com/.default"