File: test_identity_service_client_async.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 (32 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from devtools_testutils import AzureRecordedTestCase
from devtools_testutils.aio import recorded_by_proxy_async

from azure.confidentialledger.certificate.aio import (
    ConfidentialLedgerCertificateClient,
)

from _shared.testcase import ConfidentialLedgerPreparer


class TestConfidentialLedgerCertificateClient(AzureRecordedTestCase):
    @ConfidentialLedgerPreparer()
    @recorded_by_proxy_async
    async def test_get_ledger_identity(self, **kwargs):
        confidentialledger_id = kwargs.pop("confidentialledger_id")

        client = self.create_client_from_credential(
            ConfidentialLedgerCertificateClient,
            credential=None,
        )

        try:
            network_identity = (
                await client.get_ledger_identity(
                    ledger_id=confidentialledger_id
                )
            )

            assert network_identity["ledgerId"] == confidentialledger_id
            assert network_identity["ledgerTlsCertificate"]
        finally:
            await client.close()