Skip to content

Commit f3bedc1

Browse files
feat: add client_options to base client class (#150)
1 parent e640e66 commit f3bedc1

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

‎google/cloud/firestore_v1/base_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def __init__(
109109
# will have no impact since the _http() @property only lazily
110110
# creates a working HTTP object.
111111
super(BaseClient, self).__init__(
112-
project=project, credentials=credentials, _http=None
112+
project=project,
113+
credentials=credentials,
114+
client_options=client_options,
115+
_http=None,
113116
)
114117
self._client_info = client_info
115118
if client_options:

‎setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
release_status = "Development Status :: 5 - Production/Stable"
2727
dependencies = [
2828
"google-api-core[grpc] >= 1.21.0, < 2.0.0dev",
29-
"google-cloud-core >= 1.0.3, < 2.0dev",
29+
"google-cloud-core >= 1.4.1, < 2.0dev",
3030
"pytz",
3131
"libcst >= 0.2.5",
3232
"proto-plus >= 1.3.0",

‎tests/unit/v1/test_async_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ def test_constructor_with_emulator_host(self):
6363
getenv.assert_called_once_with(_FIRESTORE_EMULATOR_HOST)
6464

6565
def test_constructor_explicit(self):
66+
from google.api_core.client_options import ClientOptions
67+
6668
credentials = _make_credentials()
6769
database = "now-db"
6870
client_info = mock.Mock()
69-
client_options = mock.Mock()
71+
client_options = ClientOptions("endpoint")
7072
client = self._make_one(
7173
project=self.PROJECT,
7274
credentials=credentials,

‎tests/unit/v1/test_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ def test_constructor_with_emulator_host(self):
6161
getenv.assert_called_once_with(_FIRESTORE_EMULATOR_HOST)
6262

6363
def test_constructor_explicit(self):
64+
from google.api_core.client_options import ClientOptions
65+
6466
credentials = _make_credentials()
6567
database = "now-db"
6668
client_info = mock.Mock()
67-
client_options = mock.Mock()
69+
client_options = ClientOptions("endpoint")
6870
client = self._make_one(
6971
project=self.PROJECT,
7072
credentials=credentials,

0 commit comments

Comments
 (0)