Skip to content

Commit f2e4ab7

Browse files
committed
fixed unit tests
1 parent d5b134b commit f2e4ab7

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

tests/unit/spanner_dbapi/test_connect.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ def test_w_implicit(self, mock_client):
5555
client_info=mock.ANY,
5656
client_options=mock.ANY,
5757
route_to_leader_enabled=True,
58+
use_plain_text=False,
59+
ca_certificate=None,
60+
client_certificate=None,
61+
client_key=None,
5862
)
5963

6064
self.assertIs(connection.database, database)
@@ -97,6 +101,10 @@ def test_w_explicit(self, mock_client):
97101
client_info=mock.ANY,
98102
client_options=mock.ANY,
99103
route_to_leader_enabled=False,
104+
use_plain_text=False,
105+
ca_certificate=None,
106+
client_certificate=None,
107+
client_key=None,
100108
)
101109
client_info = mock_client.call_args_list[0][1]["client_info"]
102110
self.assertEqual(client_info.user_agent, USER_AGENT)

tests/unit/test_database.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3543,6 +3543,8 @@ def __init__(
35433543
self.credentials.expiry = None
35443544
self.credentials.valid = True
35453545

3546+
self._experimental_host = None
3547+
35463548
# Mock the spanner API to return proper session names
35473549
self._spanner_api = mock.Mock()
35483550

@@ -3560,14 +3562,11 @@ def _next_nth_request(self):
35603562

35613563

35623564
class _Instance(object):
3563-
def __init__(
3564-
self, name, client=_Client(), emulator_host=None, experimental_host=None
3565-
):
3565+
def __init__(self, name, client=_Client(), emulator_host=None):
35663566
self.name = name
35673567
self.instance_id = name.rsplit("/", 1)[1]
35683568
self._client = client
35693569
self.emulator_host = emulator_host
3570-
self.experimental_host = experimental_host
35713570

35723571

35733572
class _Backup(object):

tests/unit/test_instance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,7 @@ def __init__(self, project, timeout_seconds=None):
10231023
self.route_to_leader_enabled = True
10241024
self.directed_read_options = None
10251025
self.default_transaction_options = DefaultTransactionOptions()
1026+
self._experimental_host = None
10261027

10271028
def copy(self):
10281029
from copy import deepcopy

0 commit comments

Comments
 (0)