-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate client's adapter to api categories (#939)
- Loading branch information
1 parent
ee0a9e6
commit 9fedf49
Showing
3 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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}, | ||
) |