Fix the failed test cases which caused by gbs upgrade. 24/312024/3
authorwanchao-xu <wanchao.xu@samsung.com>
Mon, 3 Jun 2024 03:36:35 +0000 (11:36 +0800)
committerwanchao-xu <wanchao.xu@samsung.com>
Mon, 3 Jun 2024 07:41:37 +0000 (15:41 +0800)
Change-Id: Ibb338bb5cabb6ed24efed946ea40cd64c4aa1ab7
Signed-off-by: wanchao-xu <wanchao.xu@samsung.com>
tests/test_import.py
tests/test_passwdx.py

index 799e300366d75a0d5a9acc99c50df896bb1fb315..930bfff1b77fadfbb134b3ed1c1863fc739b163d 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 b7cb5399c6d4ca10241fc98c67fc9d755e899d4b..59d5a860d46c1289f0cd8ba19f4fca27d3605959 100644 (file)
@@ -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()))