Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AppConfiguration] fix tests #17917

Merged
8 commits merged into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ def test_list_configuration_settings_only_label(self, client, appconfiguration_c
assert len(items) == 1
assert all(x.label == LABEL for x in items)

@pytest.mark.skip("3 != 2, three items are returned")
@app_config_decorator
def test_list_configuration_settings_only_key(self, client, appconfiguration_connection_string, test_config_setting, test_config_setting_no_label):
items = list(client.list_configuration_settings(key_filter=KEY))
Expand All @@ -308,7 +307,6 @@ def test_list_configuration_settings_fields(self, client, appconfiguration_conne
assert len(items) == 1
assert all(x.key and not x.label and x.content_type for x in items)

@pytest.mark.skip("ResourceExistsError: Operation returned an invalid status 'Precondition Failed'")
@app_config_decorator
def test_list_configuration_settings_reserved_chars(self, client, appconfiguration_connection_string, test_config_setting, test_config_setting_no_label):
resered_char_kv = ConfigurationSetting(
Expand All @@ -323,15 +321,12 @@ def test_list_configuration_settings_reserved_chars(self, client, appconfigurati
))
assert len(items) == 1
assert all(x.label == LABEL_RESERVED_CHARS for x in items)
deleted_kv = client.delete_configuration_setting(
resered_char_kv.key, etag=resered_char_kv.etag
)
client.delete_configuration_setting(resered_char_kv.key)

@pytest.mark.skip("Creates a Bad Request")
@app_config_decorator
def test_list_configuration_settings_contains(self, client, appconfiguration_connection_string, test_config_setting, test_config_setting_no_label):
items = list(client.list_configuration_settings(
label_filter="*" + LABEL + "*"
label_filter=LABEL + "*"
))
assert len(items) == 1
assert all(x.label == LABEL for x in items)
Expand Down Expand Up @@ -411,7 +406,6 @@ def test_list_revisions_key_no_label(self, client, appconfiguration_connection_s
assert len(items) >= 1
assert all(x.key == KEY for x in items)

@pytest.mark.skip("Operation returned an invalid status 'Internal Server Error'")
@app_config_decorator
def test_list_revisions_fields(self, client, appconfiguration_connection_string, test_config_setting, test_config_setting_no_label):
items = list(client.list_revisions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ def test_list_configuration_settings_only_label(self, appconfiguration_endpoint_
assert len(items) == 1
assert all(x.label == LABEL for x in items)

@pytest.mark.skip("3 != 2, three items are returned")
@app_config_decorator
def test_list_configuration_settings_only_key(self, appconfiguration_endpoint_string, test_config_setting, test_config_setting_no_label):
client = self.create_aad_client(appconfiguration_endpoint_string)
Expand All @@ -278,7 +277,6 @@ def test_list_configuration_settings_fields(self, appconfiguration_endpoint_stri
assert len(items) == 1
assert all(x.key and not x.label and x.content_type for x in items)

@pytest.mark.skip("ResourceExistsError: Operation returned an invalid status 'Precondition Failed'")
@app_config_decorator
def test_list_configuration_settings_reserved_chars(self, appconfiguration_endpoint_string, test_config_setting, test_config_setting_no_label):
client = self.create_aad_client(appconfiguration_endpoint_string)
Expand All @@ -288,20 +286,19 @@ def test_list_configuration_settings_reserved_chars(self, appconfiguration_endpo
resered_char_kv = client.add_configuration_setting(
resered_char_kv
)
self._delete_setting(client, resered_char_kv)
escaped_label = re.sub(r"((?!^)\*(?!$)|\\|,)", r"\\\1", LABEL_RESERVED_CHARS)
items = list(client.list_configuration_settings(
label_filter=escaped_label
))
assert len(items) == 1
assert all(x.label == LABEL_RESERVED_CHARS for x in items)
client.delete_configuration_setting(resered_char_kv.key)

@pytest.mark.skip("Bad Request")
@app_config_decorator
def test_list_configuration_settings_contains(self, appconfiguration_endpoint_string, test_config_setting, test_config_setting_no_label):
client = self.create_aad_client(appconfiguration_endpoint_string)
items = list(client.list_configuration_settings(
label_filter="*" + LABEL + "*"
label_filter=LABEL + "*"
))
assert len(items) == 1
assert all(x.label == LABEL for x in items)
Expand Down Expand Up @@ -388,7 +385,6 @@ def test_list_revisions_key_no_label(self, appconfiguration_endpoint_string, tes
assert len(items) >= 1
assert all(x.key == KEY for x in items)

@pytest.mark.skip("Operation returned an invalid status 'Internal Server Error'")
@app_config_decorator
def test_list_revisions_fields(self, appconfiguration_endpoint_string, test_config_setting, test_config_setting_no_label):
client = self.create_aad_client(appconfiguration_endpoint_string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,20 @@ def test_list_configuration_settings_reserved_chars(self, appconfiguration_endpo
resered_char_kv = client.add_configuration_setting(
resered_char_kv
)
self._delete_setting(client, resered_char_kv)
escaped_label = re.sub(r"((?!^)\*(?!$)|\\|,)", r"\\\1", LABEL_RESERVED_CHARS)
items = client.list_configuration_settings(
label_filter=escaped_label
)
assert len(items) == 1
assert all(x.label == LABEL_RESERVED_CHARS for x in items)
client.delete_configuration_setting(resered_char_kv.key)

@pytest.mark.skip("Bad Request")
# NOTE: Label filter does not support wildcard at beginning on filters. https://docs.microsoft.com/en-us/azure/azure-app-configuration/rest-api-key-value#supported-filters
@app_config_decorator
def test_list_configuration_settings_contains(self, appconfiguration_endpoint_string, test_config_setting, test_config_setting_no_label):
client = self.create_aad_client(appconfiguration_endpoint_string)
items = client.list_configuration_settings(
label_filter="*" + LABEL + "*"
label_filter=LABEL + "*"
)
assert len(items) == 1
assert all(x.label == LABEL for x in items)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,17 @@ def test_list_configuration_settings_reserved_chars(self, client, appconfigurati
resered_char_kv = client.add_configuration_setting(
resered_char_kv
)
self._delete_setting(client, resered_char_kv)
escaped_label = re.sub(r"((?!^)\*(?!$)|\\|,)", r"\\\1", LABEL_RESERVED_CHARS)
items = client.list_configuration_settings(
label_filter=escaped_label
)
assert len(items) == 1
assert all(x.label == LABEL_RESERVED_CHARS for x in items)

@pytest.mark.skip("Bad Request")
@app_config_decorator
def test_list_configuration_settings_contains(self, client, appconfiguration_connection_string, test_config_setting, test_config_setting_no_label):
items = client.list_configuration_settings(
label_filter="*" + LABEL + "*"
label_filter=LABEL + "*"
)
assert len(items) == 1
assert all(x.label == LABEL for x in items)
Expand Down