Skip to content

Commit

Permalink
Rename vault fixture to remove pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
TheByronHimes committed Oct 29, 2024
1 parent 6639301 commit 14d37ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/fixtures/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def vault_container_fixture() -> Generator[VaultContainerFixture, None, None]:
yield vault_container


@pytest.fixture(scope="function")
@pytest.fixture(scope="function", name="vault")
def vault_fixture(
vault_container: VaultContainerFixture,
) -> Generator[VaultFixture, None, None]:
Expand Down
19 changes: 8 additions & 11 deletions tests/integration/test_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
[[], ["key1"], ["key1", "key2"]],
ids=["empty", "single", "multiple"],
)
async def test_happy_get(vault_fixture: VaultFixture, stored_secrets: list[str]): # noqa: F811
async def test_happy_get(vault: VaultFixture, stored_secrets: list[str]):
"""Test that the GET /secrets endpoint returns the correct response."""
vault_fixture_config = vault_fixture.config
vault_fixture_config = vault.config
config = get_config(sources=[vault_fixture_config])

for secret in stored_secrets:
vault_fixture.store_secret(key=secret)
vault.store_secret(key=secret)

async with (
prepare_rest_app(config=config) as app,
Expand All @@ -61,17 +61,14 @@ async def test_happy_get(vault_fixture: VaultFixture, stored_secrets: list[str])
[[], ["key1"], ["key1", "key2"]],
ids=["Empty", "OneKey", "TwoKeys"],
)
async def test_happy_delete(
vault_fixture: VaultFixture, # noqa: F811
stored_secrets: list[str],
):
async def test_happy_delete(vault: VaultFixture, stored_secrets: list[str]):
"""Test that the DELETE /secrets endpoint returns the correct response."""
vault_fixture_config = vault_fixture.config
vault_fixture_config = vault.config
config = get_config(sources=[vault_fixture_config])

# Store the secrets in the vault
for secret in stored_secrets:
vault_fixture.store_secret(key=secret)
vault.store_secret(key=secret)

async with (
prepare_rest_app(config=config) as app,
Expand All @@ -87,9 +84,9 @@ async def test_happy_delete(
assert response.json() == []


async def test_nonexistent_vault_path(vault_fixture: VaultFixture): # noqa: F811
async def test_nonexistent_vault_path(vault: VaultFixture):
"""Ensure both endpoint return the right response when `vault_path` doesn't exist."""
vault_fixture_config = vault_fixture.config
vault_fixture_config = vault.config
config = get_config(sources=[vault_fixture_config])

async with (
Expand Down

0 comments on commit 14d37ad

Please sign in to comment.