File: test_client.py

package info (click to toggle)
python-hvac 2.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,800 kB
  • sloc: python: 29,360; makefile: 42; sh: 14
file content (20 lines) | stat: -rw-r--r-- 577 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
from unittest import TestCase

from hvac import Client
from hvac.adapters import JSONAdapter


class TestClient(TestCase):
    """Unit tests providing coverage for client related methods."""

    def test_setting_adapter_on_client_sets_adapter_of_endpoint_classes(self):
        client = Client()
        old_adapter = client.adapter

        client.adapter = JSONAdapter()

        self.assertIsNot(client.adapter, old_adapter)
        self.assertSetEqual(
            {client.adapter},
            {client.secrets.adapter, client.sys.adapter, client.auth.adapter},
        )