Skip to content

Commit 613ca53

Browse files
committed
fix test
1 parent f9d5678 commit 613ca53

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/catalog/test_rest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,18 @@ def test_list_namespaces_token_expired_success_on_retries(rest_mock: Mocker, sta
602602
status_code=200,
603603
)
604604
catalog = RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN, credential=TEST_CREDENTIALS)
605+
# LegacyOAuth2AuthManager is created twice through `_create_session()`
606+
# which results in the token being refreshed twice when the RestCatalog is initialized.
607+
assert tokens.call_count == 2
608+
605609
assert catalog.list_namespaces() == [
606610
("default",),
607611
("examples",),
608612
("fokko",),
609613
("system",),
610614
]
611615
assert namespaces.call_count == 2
612-
assert tokens.call_count == 1
616+
assert tokens.call_count == 3
613617

614618
assert catalog.list_namespaces() == [
615619
("default",),
@@ -618,7 +622,7 @@ def test_list_namespaces_token_expired_success_on_retries(rest_mock: Mocker, sta
618622
("system",),
619623
]
620624
assert namespaces.call_count == 3
621-
assert tokens.call_count == 1
625+
assert tokens.call_count == 3
622626

623627

624628
def test_create_namespace_200(rest_mock: Mocker) -> None:

0 commit comments

Comments
 (0)