Skip to content

Commit

Permalink
fix weaviate auth tests (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Feb 26, 2024
1 parent 7a8a292 commit f1e4f06
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions integrations/weaviate/tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class TestAuthApiKey:
def test_init(self):
credentials = AuthApiKey()
assert credentials.api_key._env_vars == ["WEAVIATE_API_KEY"]
assert credentials.api_key._env_vars == ("WEAVIATE_API_KEY",)
assert credentials.api_key._strict

def test_to_dict(self):
Expand All @@ -33,7 +33,7 @@ def test_from_dict(self, monkeypatch):
}
)
assert isinstance(credentials, AuthApiKey)
assert credentials.api_key._env_vars == ["WEAVIATE_API_KEY"]
assert credentials.api_key._env_vars == ("WEAVIATE_API_KEY",)
assert credentials.api_key._strict

def test_resolve_value(self, monkeypatch):
Expand All @@ -47,10 +47,10 @@ def test_resolve_value(self, monkeypatch):
class TestAuthBearerToken:
def test_init(self):
credentials = AuthBearerToken()
assert credentials.access_token._env_vars == ["WEAVIATE_ACCESS_TOKEN"]
assert credentials.access_token._env_vars == ("WEAVIATE_ACCESS_TOKEN",)
assert credentials.access_token._strict
assert credentials.expires_in == 60
assert credentials.refresh_token._env_vars == ["WEAVIATE_REFRESH_TOKEN"]
assert credentials.refresh_token._env_vars == ("WEAVIATE_REFRESH_TOKEN",)
assert not credentials.refresh_token._strict

def test_to_dict(self):
Expand All @@ -75,10 +75,10 @@ def test_from_dict(self):
},
}
)
assert credentials.access_token._env_vars == ["WEAVIATE_ACCESS_TOKEN"]
assert credentials.access_token._env_vars == ("WEAVIATE_ACCESS_TOKEN",)
assert credentials.access_token._strict
assert credentials.expires_in == 10
assert credentials.refresh_token._env_vars == ["WEAVIATE_REFRESH_TOKEN"]
assert credentials.refresh_token._env_vars == ("WEAVIATE_REFRESH_TOKEN",)
assert not credentials.refresh_token._strict

def test_resolve_value(self, monkeypatch):
Expand All @@ -95,9 +95,9 @@ def test_resolve_value(self, monkeypatch):
class TestAuthClientCredentials:
def test_init(self):
credentials = AuthClientCredentials()
assert credentials.client_secret._env_vars == ["WEAVIATE_CLIENT_SECRET"]
assert credentials.client_secret._env_vars == ("WEAVIATE_CLIENT_SECRET",)
assert credentials.client_secret._strict
assert credentials.scope._env_vars == ["WEAVIATE_SCOPE"]
assert credentials.scope._env_vars == ("WEAVIATE_SCOPE",)
assert not credentials.scope._strict

def test_to_dict(self):
Expand All @@ -120,9 +120,9 @@ def test_from_dict(self):
},
}
)
assert credentials.client_secret._env_vars == ["WEAVIATE_CLIENT_SECRET"]
assert credentials.client_secret._env_vars == ("WEAVIATE_CLIENT_SECRET",)
assert credentials.client_secret._strict
assert credentials.scope._env_vars == ["WEAVIATE_SCOPE"]
assert credentials.scope._env_vars == ("WEAVIATE_SCOPE",)
assert not credentials.scope._strict

def test_resolve_value(self, monkeypatch):
Expand All @@ -138,11 +138,11 @@ def test_resolve_value(self, monkeypatch):
class TestAuthClientPassword:
def test_init(self):
credentials = AuthClientPassword()
assert credentials.username._env_vars == ["WEAVIATE_USERNAME"]
assert credentials.username._env_vars == ("WEAVIATE_USERNAME",)
assert credentials.username._strict
assert credentials.password._env_vars == ["WEAVIATE_PASSWORD"]
assert credentials.password._env_vars == ("WEAVIATE_PASSWORD",)
assert credentials.password._strict
assert credentials.scope._env_vars == ["WEAVIATE_SCOPE"]
assert credentials.scope._env_vars == ("WEAVIATE_SCOPE",)
assert not credentials.scope._strict

def test_to_dict(self):
Expand All @@ -167,11 +167,11 @@ def test_from_dict(self):
},
}
)
assert credentials.username._env_vars == ["WEAVIATE_USERNAME"]
assert credentials.username._env_vars == ("WEAVIATE_USERNAME",)
assert credentials.username._strict
assert credentials.password._env_vars == ["WEAVIATE_PASSWORD"]
assert credentials.password._env_vars == ("WEAVIATE_PASSWORD",)
assert credentials.password._strict
assert credentials.scope._env_vars == ["WEAVIATE_SCOPE"]
assert credentials.scope._env_vars == ("WEAVIATE_SCOPE",)
assert not credentials.scope._strict

def test_resolve_value(self, monkeypatch):
Expand Down

0 comments on commit f1e4f06

Please sign in to comment.