Skip to content

Commit 70aa081

Browse files
chore: fix tests
1 parent 6ce9c40 commit 70aa081

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

tests/unit/test_instance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ async def test_Instance_init(
4747
can tell if the connection string that's passed in is formatted correctly.
4848
"""
4949
assert (
50-
cache._project == "test-project"
51-
and cache._region == "test-region"
52-
and cache._instance == "test-instance"
50+
cache._conn_name.project == "test-project"
51+
and cache._conn_name.region == "test-region"
52+
and cache._conn_name.instance_name == "test-instance"
5353
)
5454
assert cache._enable_iam_auth is False
5555

@@ -283,7 +283,7 @@ async def test_AutoIAMAuthNotSupportedError(fake_client: CloudSQLClient) -> None
283283

284284
async def test_ConnectionInfo_caches_sslcontext() -> None:
285285
info = ConnectionInfo(
286-
"cert", "cert", "key".encode(), {}, "POSTGRES", datetime.datetime.now()
286+
"", "cert", "cert", "key".encode(), {}, "POSTGRES", datetime.datetime.now()
287287
)
288288
# context should default to None
289289
assert info.context is None

tests/unit/test_resolver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626

2727
conn_str = "my-project:my-region:my-instance"
2828
conn_name = ConnectionName("my-project", "my-region", "my-instance")
29+
conn_name_with_domain = ConnectionName(
30+
"my-project", "my-region", "my-instance", "db.example.com"
31+
)
2932

3033

3134
async def test_DefaultResolver() -> None:
@@ -74,7 +77,7 @@ async def test_DnsResolver_with_dns_name() -> None:
7477
resolver.port = 5053
7578
# Resolution should return first value sorted alphabetically
7679
result = await resolver.resolve("db.example.com")
77-
assert result == conn_name
80+
assert result == conn_name_with_domain
7881

7982

8083
query_text_malformed = """id 1234

0 commit comments

Comments
 (0)