Skip to content

Commit ecaeff5

Browse files
CopilotAsafMah
andcommitted
Undo changes to test_e2e_data.py
Co-authored-by: AsafMah <[email protected]>
1 parent 11baa72 commit ecaeff5

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

azure-kusto-data/tests/test_e2e_data.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -333,40 +333,11 @@ async def test_log_analytics_query_async(self):
333333
def test_cloud_info(self):
334334
if ".dev." in self.engine_cs:
335335
pytest.skip("This test is not relevant for dev clusters")
336-
337-
# Clear the cache before testing
338-
with CloudSettings._cloud_cache_lock:
339-
CloudSettings._cloud_cache.clear()
340-
341-
# Get cloud info for the original URI
342336
cloud_info = CloudSettings.get_cloud_info_for_cluster(self.engine_cs)
343337
assert cloud_info is not CloudSettings.DEFAULT_CLOUD
344338
assert cloud_info == CloudSettings.DEFAULT_CLOUD
345-
346-
# Test same instance is returned for same authority
347339
assert cloud_info is CloudSettings.get_cloud_info_for_cluster(self.engine_cs)
348-
349-
# Test different paths with same authority use the same cache entry
350-
with_path = urljoin(self.engine_cs, "/test1/test2/test3")
351-
assert cloud_info is CloudSettings.get_cloud_info_for_cluster(with_path)
352-
353-
# Test another path variation
354-
with_db_path = urljoin(self.engine_cs, "/database")
355-
assert cloud_info is CloudSettings.get_cloud_info_for_cluster(with_db_path)
356-
357-
# Test that URLs with different ports are cached separately
358-
from urllib.parse import urlparse
359-
360-
url_parts = urlparse(self.engine_cs)
361-
362-
# Only run this test if the original URL doesn't already specify a port
363-
if not url_parts.port:
364-
# Create a URL with a different port
365-
with_port = f"{url_parts.scheme}://{url_parts.netloc}:8080"
366-
port_cloud_info = CloudSettings.get_cloud_info_for_cluster(with_port)
367-
368-
# Should be a different instance from the original
369-
assert port_cloud_info is not cloud_info
340+
assert cloud_info == CloudSettings.get_cloud_info_for_cluster(urljoin(self.engine_cs, "/test1/test2/test3"))
370341

371342
def test_cloud_info_404(self):
372343
pytest.skip("This test is currently wrong - until all cluster are updated to the redirect uri, this test will fail")

0 commit comments

Comments
 (0)