Skip to content

Commit d590620

Browse files
authored
Version bump to 3.11.0 (#276)
* skip client tests * re-add client tests, fix marqo cloud URL * delete marqo cloud url at test start * add setUp and tearDown to tests * version bump
1 parent 692ee88 commit d590620

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"tox"
1717
],
1818
name="marqo",
19-
version="3.10.0",
19+
version="3.11.0",
2020
author="marqo org",
2121
author_email="[email protected]",
2222
description="Tensor search for humans",

tests/v2_tests/test_client.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@
1717

1818
@mark.fixed
1919
class TestClient(MarqoTestCase):
20+
def setUp(self) -> None:
21+
super().setUp()
22+
self.initial_marqo_cloud_url = os.environ.get("MARQO_CLOUD_URL", constants.CLOUD_AWS_API_ENDPOINT)
23+
24+
def tearDown(self) -> None:
25+
super().tearDown()
26+
os.environ["MARQO_CLOUD_URL"] = self.initial_marqo_cloud_url
27+
2028
def test_check_index_health_response(self):
2129
for cloud_test_index_to_use, open_source_test_index_name in self.test_cases:
2230
test_index_name = self.get_test_index_name(
@@ -39,17 +47,16 @@ def test_check_index_health_query(self):
3947
self.assertIn(f"health", kwargs["path"])
4048

4149
def test_overwrite_cloud_url_and_client_is_set_to_marqo(self):
42-
current = os.environ.get("MARQO_CLOUD_URL", constants.CLOUD_AWS_API_ENDPOINT)
4350
os.environ["MARQO_CLOUD_URL"] = "https://cloud.url.com"
4451
client = Client(url="https://cloud.url.com", api_key="test")
4552
self.assertTrue(client.config.is_marqo_cloud)
46-
os.environ["MARQO_CLOUD_URL"] = current
4753

4854
def test_default_cloud_endpoint_client_is_marqo_cloud(self):
4955
"""
50-
Checks that if a client is created with one of the 2 cloud URLs (AWS or GCP),
56+
Checks that if MARQO_CLOUD_URL is not set and a client is created with one of the 2 cloud URLs (AWS or GCP),
5157
the client is set to Marqo Cloud.
5258
"""
59+
del os.environ["MARQO_CLOUD_URL"]
5360
for cloud_url in constants.CLOUD_API_ENDPOINTS:
5461
client = Client(url=cloud_url)
5562
self.assertTrue(client.config.is_marqo_cloud)
@@ -58,8 +65,10 @@ def test_default_cloud_endpoint_client_is_marqo_cloud(self):
5865

5966
def test_non_cloud_endpoint_client_is_not_marqo_cloud(self):
6067
"""
61-
Checks that if a client is created with a non-cloud URL, the client is not set to Marqo Cloud.
68+
Checks that if MARQO_CLOUD_URL is not set and a client is created with a non-cloud URL,
69+
the client is not set to Marqo Cloud.
6270
"""
71+
del os.environ["MARQO_CLOUD_URL"]
6372
client = Client(url="https://arandomsite.ai")
6473
self.assertFalse(client.config.is_marqo_cloud)
6574
self.assertIsInstance(client.config.instance_mapping, DefaultInstanceMappings)
@@ -69,9 +78,11 @@ def test_non_cloud_endpoint_client_is_not_marqo_cloud(self):
6978
@mark.fixed
7079
class TestClientMethods(MarqoTestCase):
7180
def setUp(self) -> None:
81+
super().setUp()
7282
self.initial_marqo_cloud_url = os.environ.get("MARQO_CLOUD_URL", constants.CLOUD_AWS_API_ENDPOINT)
7383

7484
def tearDown(self) -> None:
85+
super().tearDown()
7586
os.environ["MARQO_CLOUD_URL"] = self.initial_marqo_cloud_url
7687

7788
def test_is_cloud_api_endpoint(self):

0 commit comments

Comments
 (0)