Skip to content

Commit

Permalink
[pre-commit.ci] Apply automatic pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Oct 30, 2023
1 parent 2f6cb7f commit bd50f0b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/nebari/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ class Main(Base):
@field_validator("nebari_version")
@classmethod
def check_default(cls, value):
assert cls.is_version_accepted(value), f"nebari_version={value} is not an accepted version, it must be equivalent to {__version__}.\nInstall a different version of nebari or run nebari upgrade to ensure your config file is compatible."
assert cls.is_version_accepted(
value
), f"nebari_version={value} is not an accepted version, it must be equivalent to {__version__}.\nInstall a different version of nebari or run nebari upgrade to ensure your config file is compatible."
return value

@classmethod
Expand Down
5 changes: 4 additions & 1 deletion tests/tests_unit/test_cli_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,10 @@ def test_cli_upgrade_to_2023_10_1_kubernetes_validations(
assert end_version == upgraded["nebari_version"]

if k8s_status == "invalid":
assert f"Unable to detect Kubernetes version for provider {provider}" in result.stdout
assert (
f"Unable to detect Kubernetes version for provider {provider}"
in result.stdout
)


def assert_nebari_upgrade_success(
Expand Down
8 changes: 7 additions & 1 deletion tests/tests_unit/test_cli_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,13 @@ def test_cli_validate_from_env():
"key, value, provider, expected_message, addl_config",
[
("NEBARI_SECRET__project_name", "123invalid", "local", "validation error", {}),
("NEBARI_SECRET__this_is_an_error", "true", "local", "Object has no attribute", {}),
(
"NEBARI_SECRET__this_is_an_error",
"true",
"local",
"Object has no attribute",
{},
),
(
"NEBARI_SECRET__amazon_web_services__kubernetes_version",
"1.0",
Expand Down
6 changes: 5 additions & 1 deletion tests/tests_unit/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ def test_kubernetes_version(config_schema):
config_dict = {
"project_name": "test",
"provider": "gcp",
"google_cloud_platform": {"project": "test", "region": "us-east1" ,"kubernetes_version": "1.23"},
"google_cloud_platform": {
"project": "test",
"region": "us-east1",
"kubernetes_version": "1.23",
},
}
config = config_schema(**config_dict)
assert config.provider == "gcp"
Expand Down

0 comments on commit bd50f0b

Please sign in to comment.