代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/anaconda 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 5dc9b2ee4dde7b6deb477b581759c5f76dcb87b5 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <[email protected]>
Date: Fri, 19 Jun 2020 15:57:57 +0200
Subject: [PATCH] Add tests for verify_valid_installtree function (#1844287)
It's testing if repodata/repomd.xml file exists.
Related: rhbz#1844287
Related: rhbz#1849093
---
.../module_source_base_test.py | 23 ++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/tests/nosetests/pyanaconda_tests/module_source_base_test.py b/tests/nosetests/pyanaconda_tests/module_source_base_test.py
index f58e2b1639..3ba40edf4c 100644
--- a/tests/nosetests/pyanaconda_tests/module_source_base_test.py
+++ b/tests/nosetests/pyanaconda_tests/module_source_base_test.py
@@ -16,6 +16,8 @@
# Red Hat, Inc.
#
import unittest
+from pathlib import Path
+from tempfile import TemporaryDirectory
from unittest.mock import patch
from pyanaconda.core.constants import INSTALL_TREE
@@ -23,7 +25,8 @@
from pyanaconda.modules.payloads.constants import SourceType
from pyanaconda.modules.payloads.source.mount_tasks import SetUpMountTask, TearDownMountTask
from pyanaconda.modules.payloads.source.source_base import MountingSourceMixin
-from pyanaconda.modules.payloads.source.utils import find_and_mount_iso_image
+from pyanaconda.modules.payloads.source.utils import find_and_mount_iso_image, \
+ verify_valid_installtree
mount_location = "/some/dir"
@@ -184,3 +187,21 @@ def find_and_mount_iso_image_fail_mount_test(self,
)
self.assertEqual(iso_name, "")
+
+ def verify_valid_installtree_success_test(self):
+ """Test verify_valid_installtree functionality success."""
+ with TemporaryDirectory() as tmp:
+ repodir_path = Path(tmp, "repodata")
+ repodir_path.mkdir()
+ repomd_path = Path(repodir_path, "repomd.xml")
+ repomd_path.write_text("This is a cool repomd file!")
+
+ self.assertTrue(verify_valid_installtree(tmp))
+
+ def verify_valid_installtree_failed_test(self):
+ """Test verify_valid_installtree functionality failed."""
+ with TemporaryDirectory() as tmp:
+ repodir_path = Path(tmp, "repodata")
+ repodir_path.mkdir()
+
+ self.assertFalse(verify_valid_installtree(tmp))
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。