Skip to content
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
14 changes: 14 additions & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
from unittest.mock import PropertyMock

import pytest


# This causes every test defined in this file to run 2 times, each with
# charm.JujuVersion.has_secrets set as True or as False
@pytest.fixture(params=[True, False], autouse=True)
def _has_secrets(request, monkeypatch):
monkeypatch.setattr("charm.JujuVersion.has_secrets", PropertyMock(return_value=request.param))
return request.param
1,381 changes: 704 additions & 677 deletions tests/unit/test_backups.py

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,6 @@ def harness():
harness.cleanup()


# This causes every test defined in this file to run 2 times, each with
# charm.JujuVersion.has_secrets set as True or as False
@pytest.fixture(params=[True, False], autouse=True)
def _has_secrets(request, monkeypatch):
monkeypatch.setattr("charm.JujuVersion.has_secrets", PropertyMock(return_value=request.param))
return request.param


@patch_network_get(private_address="1.1.1.1")
def test_on_install(harness):
with patch("charm.subprocess.check_call") as _check_call, patch(
Expand Down
Loading