From: wanchao-xu Date: Mon, 3 Jun 2024 03:36:35 +0000 (+0800) Subject: Fix the failed test cases which caused by gbs upgrade. X-Git-Tag: accepted/tools/devbase/tools/20250527.103741~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19cc308bcbca9ca68ee066d664e41192bee6552d;p=tools%2Fgbs.git Fix the failed test cases which caused by gbs upgrade. Change-Id: Ibb338bb5cabb6ed24efed946ea40cd64c4aa1ab7 Signed-off-by: wanchao-xu --- diff --git a/tests/test_import.py b/tests/test_import.py index 799e300..930bfff 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -149,7 +149,7 @@ class TestImport(unittest.TestCase): """Test raising exception when importing from non-parseable spec.""" GBS(argv=["gbs", "import", spec]) - @raises(SystemExit) + @raises(GbsError) def test_missing_argument(self): """Test raising exception when running gbs without any arguments.""" GBS(argv=["gbs", "import"]) diff --git a/tests/test_passwdx.py b/tests/test_passwdx.py index b7cb539..59d5a86 100644 --- a/tests/test_passwdx.py +++ b/tests/test_passwdx.py @@ -69,10 +69,12 @@ class PasswdxTest(unittest.TestCase): self.assertEqual('''[remotebuild] build_server = https://api +# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s [build] repo1.url = https://repo1 +# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside repo1.passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s ''', conf.getvalue()) @@ -92,21 +94,25 @@ repo1.passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s self.assertEqual('''[remotebuild] build_server = https://api +# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s [build] repo1.url = https://repo1 +# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside repo1.passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s ''', confs[0].getvalue()) self.assertEqual('''[remotebuild] build_server = https://api user = test +# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s [build] repo1.url = https://repo1 repo1.user = test +# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside repo1.passwdx = QlpoOTFBWSZTWYfNdxYAAAIBgAoAHAAgADDNAMNEA24u5IpwoSEPmu4s ''', confs[1].getvalue()) @@ -153,7 +159,7 @@ class AutoGenerateTest(unittest.TestCase): @Fixture() def test_auto_generate_conf(self, fake_open, _fake_chmod): - 'test auto generate conf should contain obs and repos' + 'test auto generate conf should contain repos' conf = FakeFile() fake_open.return_value = conf @@ -163,10 +169,8 @@ class AutoGenerateTest(unittest.TestCase): parser.readfp(StringIO(conf.getvalue())) name = parser.get('general', 'profile') - obs = parser.get(name, 'obs') repos = parser.get(name, 'repos') - self.assertTrue(parser.has_section(obs)) for repo in repos.split(','): self.assertTrue(parser.has_section(repo.strip()))