Fix the failed test cases which caused by gbs upgrade. 23/312023/2 accepted/tools_devbase_tools_legacy devel-py2 accepted/tools/devbase/tools/legacy/20250527.042503
authorwanchao-xu <wanchao.xu@samsung.com>
Mon, 3 Jun 2024 03:31:20 +0000 (11:31 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Mon, 3 Jun 2024 05:53:20 +0000 (13:53 +0800)
Change-Id: I663dde6d9b6e0cf45adeecd8a12a6e3a29c98498
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
tests/test_import.py
tests/test_passwdx.py

index 1eabbca7ef96acd06c236a3d24edbe1063649eb4..2fd51ddfd6e802f8ce3aaeaccb81141112774304 100644 (file)
@@ -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"])
index d63e1936f44d411ad493224e069fc91186699989..b9bf824a3ac9a0af3ce5afea37f66c972970df87 100644 (file)
@@ -69,10 +69,12 @@ class PasswdxTest(unittest.TestCase):
 
         self.assertEquals('''[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.assertEquals('''[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.assertEquals('''[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()))