archives: do not keep update.xml text in field

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2022-06-11 11:58:15 +09:00
parent ec08c15d2d
commit 638f94a690
3 changed files with 16 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
import os
from pathlib import Path
import pytest
@@ -21,8 +22,7 @@ def setup():
)
def test_parse_update_xml(monkeypatch, os_name, version, flavor, datafile):
def _mock(self, url):
with open(os.path.join(os.path.dirname(__file__), "data", datafile), "r") as f:
self.update_xml_text = f.read()
return (Path(__file__).parent / "data" / datafile).read_text("utf-8")
monkeypatch.setattr(QtArchives, "_download_update_xml", _mock)