Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Dec 7, 2024
1 parent 6ce9c40 commit 70aa081
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ async def test_Instance_init(
can tell if the connection string that's passed in is formatted correctly.
"""
assert (
cache._project == "test-project"
and cache._region == "test-region"
and cache._instance == "test-instance"
cache._conn_name.project == "test-project"
and cache._conn_name.region == "test-region"
and cache._conn_name.instance_name == "test-instance"
)
assert cache._enable_iam_auth is False

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

async def test_ConnectionInfo_caches_sslcontext() -> None:
info = ConnectionInfo(
"cert", "cert", "key".encode(), {}, "POSTGRES", datetime.datetime.now()
"", "cert", "cert", "key".encode(), {}, "POSTGRES", datetime.datetime.now()
)
# context should default to None
assert info.context is None
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/test_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

conn_str = "my-project:my-region:my-instance"
conn_name = ConnectionName("my-project", "my-region", "my-instance")
conn_name_with_domain = ConnectionName(
"my-project", "my-region", "my-instance", "db.example.com"
)


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


query_text_malformed = """id 1234
Expand Down

0 comments on commit 70aa081

Please sign in to comment.