From 6630a1642be3adf5cec708aa508fea6fdefdf286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9C=88?= Date: Tue, 10 Dec 2024 14:40:52 +0800 Subject: [PATCH] Add unit test and optimize information --- README.en.md | 4 ++++ README.md | 2 ++ main.py | 2 +- test/test_localcheck.py | 9 +++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.en.md b/README.en.md index c3f81c9..aaa24e2 100644 --- a/README.en.md +++ b/README.en.md @@ -29,12 +29,16 @@ usage: kyclassifier -h -iso ISO_FILE_PATH -repo -local + -console_log + -q_rpminiso optional arguments: -h, --help show this help message and exit -iso ISO Input ISO file path -repo Whether to analyze repo packages. -local Whether to analyze local installed packages. + -console_log Output log to console. + -q_rpminiso Query input rpm layer in iso #### Contribution diff --git a/README.md b/README.md index 46854ac..7a9b470 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ usage: kyclassifier -h -repo -local -console_log + -q_rpminiso optional arguments: -h, --help show this help message and exit @@ -39,6 +40,7 @@ optional arguments: -repo Whether to analyze repo packages. -local Whether to analyze local installed packages. -console_log Output log to console. + -q_rpminiso Query input rpm layer in iso #### 参与贡献 diff --git a/main.py b/main.py index dd742ef..6748a5c 100644 --- a/main.py +++ b/main.py @@ -140,7 +140,7 @@ if __name__ == '__main__': if args.q_rpminiso: layer = QueryLayerInIso.run(args.q_rpminiso) if layer < 0: - logger.info("Check error,skipped query rpm layer in iso.") + logger.error("Check error,skipped query rpm layer in iso.") else: logger.info("Rpm layer in iso is {}".format(layer)) diff --git a/test/test_localcheck.py b/test/test_localcheck.py index e429869..0327446 100644 --- a/test/test_localcheck.py +++ b/test/test_localcheck.py @@ -38,6 +38,15 @@ class TestLocalCheck(unittest.TestCase): result = self.local_check.check_pkgsmissreq() self.assertIsInstance(result, dict, "check_pkgsmissreq test failed!") + def test_check_pkgsconflicts(self): + """Test class method check_pkgsconflicts() + + Returns: + bool + """ + result = self.local_check.check_pkgsconflicts() + self.assertIsInstance(result, dict, "check_pkgsconflicts test failed!") + def test_check(self): """Test class method check() -- Gitee