Skip to content

Commit a3ac220

Browse files
committed
chore: refactor integration tests
1 parent 75a8a83 commit a3ac220

File tree

3 files changed

+661
-395
lines changed

3 files changed

+661
-395
lines changed

src/ops2deb/updater.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ def _update_configuration(
253253
if max_versions == 1:
254254
if release.blueprint.matrix and release.blueprint.matrix.versions:
255255
removed_versions = raw_blueprint["matrix"].pop("versions")
256+
if not raw_blueprint["matrix"]:
257+
raw_blueprint.pop("matrix")
256258
else:
257259
removed_versions = [raw_blueprint["version"]]
258260
raw_blueprint["version"] = release.version
@@ -285,7 +287,6 @@ def _update_lockfile(
285287
for version in removed_versions:
286288
lock.remove(_blueprint_fetch_urls(blueprint, version))
287289
_blueprint_fetch_urls(blueprint, release.version)
288-
# blueprint.metadata.lock.add(urls)
289290

290291

291292
def update(

tests/conftest.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,18 @@ def _blueprint_factory(construct: bool = False, **kwargs):
167167
return _blueprint_factory
168168

169169

170+
@pytest.fixture
171+
def summary_path(tmp_path) -> Path:
172+
return tmp_path / "summary.log"
173+
174+
175+
@pytest.fixture
176+
def cache_path(tmp_path) -> Path:
177+
path = tmp_path / "cache"
178+
path.mkdir(exist_ok=True)
179+
return path
180+
181+
170182
@pytest.fixture
171183
def configuration_path(tmp_path) -> Path:
172184
return tmp_path / "ops2deb-0.yml"
@@ -188,8 +200,8 @@ def lockfile_paths(tmp_path) -> list[Path]:
188200

189201

190202
@pytest.fixture
191-
def mock_lockfile(lockfile_path) -> None:
192-
lockfile_content = """
203+
def lockfile_content(lockfile_path) -> None:
204+
content = """
193205
- url: http://testserver/1.0.0/dangling-symlink.tar.xz
194206
sha256: 7010dc76519072ceb552433f0eda2904dba197312fc9abd946cdcece65ba2af5
195207
timestamp: 2022-12-29 13:14:57+00:00
@@ -215,4 +227,4 @@ def mock_lockfile(lockfile_path) -> None:
215227
sha256: deadbeaf
216228
timestamp: 2022-12-29 13:14:57+00:00
217229
"""
218-
lockfile_path.write_text(dedent(lockfile_content))
230+
lockfile_path.write_text(dedent(content))

0 commit comments

Comments
 (0)