-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tags to create and configure index
- Loading branch information
Showing
6 changed files
with
67 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class TestCreateIndexPods: | ||
def test_create_with_optional_tags(self, client, create_index_params): | ||
index_name = create_index_params["name"] | ||
tags = {"foo": "FOO", "bar": "BAR"} | ||
create_index_params["tags"] = create_index_params | ||
|
||
client.create_index(**create_index_params) | ||
|
||
desc = client.describe_index(name=index_name) | ||
assert desc.tags.to_dict() == tags |
File renamed without changes.
40 changes: 40 additions & 0 deletions
40
tests/integration/control/serverless/test_configure_index_tags.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import pytest | ||
|
||
|
||
class TestIndexTags: | ||
def test_index_tags_none_by_default(self, client, ready_sl_index): | ||
client.describe_index(name=ready_sl_index) | ||
assert client.describe_index(name=ready_sl_index).tags is None | ||
|
||
def test_add_index_tags(self, client, ready_sl_index): | ||
client.configure_index(name=ready_sl_index, tags={"foo": "FOO", "bar": "BAR"}) | ||
assert client.describe_index(name=ready_sl_index).tags.to_dict() == { | ||
"foo": "FOO", | ||
"bar": "BAR", | ||
} | ||
|
||
def test_remove_tags_by_setting_empty_value_for_key(self, client, ready_sl_index): | ||
client.configure_index(name=ready_sl_index, tags={"foo": "FOO", "bar": "BAR"}) | ||
client.configure_index(name=ready_sl_index, tags={}) | ||
assert client.describe_index(name=ready_sl_index).tags.to_dict() == { | ||
"foo": "FOO", | ||
"bar": "BAR", | ||
} | ||
|
||
client.configure_index(name=ready_sl_index, tags={"foo": ""}) | ||
assert client.describe_index(name=ready_sl_index).tags.to_dict() == {"bar": "BAR"} | ||
|
||
def test_merge_new_tags_with_existing_tags(self, client, ready_sl_index): | ||
client.configure_index(name=ready_sl_index, tags={"foo": "FOO", "bar": "BAR"}) | ||
client.configure_index(name=ready_sl_index, tags={"baz": "BAZ"}) | ||
assert client.describe_index(name=ready_sl_index).tags.to_dict() == { | ||
"foo": "FOO", | ||
"bar": "BAR", | ||
"baz": "BAZ", | ||
} | ||
|
||
@pytest.mark.skip(reason="Backend bug filed") | ||
def test_remove_all_tags(self, client, ready_sl_index): | ||
client.configure_index(name=ready_sl_index, tags={"foo": "FOO", "bar": "BAR"}) | ||
client.configure_index(name=ready_sl_index, tags={"foo": "", "bar": ""}) | ||
assert client.describe_index(name=ready_sl_index).tags is None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.