File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ def __init__(
2323 settings: The settings to use for the client.
2424 """
2525
26- self ._settings = settings
26+ self ._settings = settings . copy ()
2727
2828 if not self ._settings .api_key :
2929 raise ValueError (
@@ -70,7 +70,7 @@ def get_default(cls) -> Self:
7070 """
7171 from . import settings as default_settings
7272
73- if cls ._default is None :
73+ if cls ._default is None or cls . _default . settings != default_settings :
7474 with cls ._lock :
7575 if cls ._default is None or cls ._default .settings != default_settings :
7676 cls ._default = cls (settings = default_settings )
Original file line number Diff line number Diff line change 77
88setup (
99 name = "assemblyai" ,
10- version = "0.7.2 " ,
10+ version = "0.7.1 " ,
1111 description = "AssemblyAI Python SDK" ,
1212 author = "AssemblyAI" ,
1313
Original file line number Diff line number Diff line change 66import pytest
77from pytest_httpx import HTTPXMock
88
9- import assemblyai .developer_tools .python .sdk .tests .unit .factories as factories
109import assemblyai as aai
10+ from tests .unit import factories
1111
1212aai .settings .api_key = "test"
1313
Original file line number Diff line number Diff line change 1+ import assemblyai as aai
2+
3+
4+ def test_reset_client_on_settings_change ():
5+ """
6+ Test that the settings are reset when the global settings have changed.
7+ """
8+ aai .settings .api_key = "before"
9+ transcriber = aai .Transcriber ()
10+
11+ assert transcriber ._client .settings .api_key == "before"
12+
13+ aai .settings .api_key = "after"
14+ transcriber = aai .Transcriber ()
15+
16+ assert transcriber ._client .settings .api_key == "after"
You can’t perform that action at this time.
0 commit comments