merge the latest code from master
authorwangbiao <biao716.wang@samsung.com>
Fri, 22 Mar 2024 07:02:46 +0000 (16:02 +0900)
committerwangbiao <biao716.wang@samsung.com>
Fri, 22 Mar 2024 07:02:46 +0000 (16:02 +0900)
Change-Id: Ia89f2322965fbb1f142729760c3f8a66fed9c2f2
Signed-off-by: wangbiao <biao716.wang@samsung.com>
12 files changed:
1  2 
gitbuildsys/cmd_build.py
gitbuildsys/cmd_export.py
gitbuildsys/conf.py
gitbuildsys/utils.py
tests/test_changelog.py
tests/test_config.py
tests/test_export.py
tests/test_help.py
tests/test_import.py
tests/test_passwdx.py
tests/test_profile.py
tools/gbs

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 8faf159bc169821040a9dbfbcc2648f5f0650f86,3035855262576b96e10488705398991b54ea8daa..845cd1bedb819f38b280de4b131ff012ce5774db
@@@ -131,27 -130,29 +131,29 @@@ class ConfigGettingTest(unittest.TestCa
          self.assertEqual('projv1', self.get('section', 'common_key'))
  
      @Fixture(home='home1.ini')
 -    def test_default_value(self):
 +    def test_default_value_pos1(self):
          'test get hardcode default value '
-         self.assertEquals('/var/tmp', self.get('general', 'tmpdir'))
+         self.assertEqual('/var/tmp', self.get('general', 'tmpdir'))
  
      @Fixture(home='without_section_header.ini')
 -    def test_invalid_ini(self):
 +    def test_invalid_ini_neg1(self):
          'test invalid ini'
          self.assertRaises(ConfigError, reload, gitbuildsys.conf)
  
      @Fixture(home='invalid_continuation_line.ini')
 -    def test_invalid_continuation_line(self):
 +    def test_invalid_continuation_line_neg1(self):
          'test invalid cointinuation line'
-         self.assertRaises(ConfigError, reload, gitbuildsys.conf)
+         #for python3.x, it is no error if there is ' ' before option,
+         reload(gitbuildsys.conf)
+         #self.assertRaises(ConfigError, reload, gitbuildsys.conf)
  
      @Fixture(home='interpolation.ini')
 -    def test_interpolation(self):
 +    def test_interpolation_pos1(self):
          'test interpolation is supported'
-         self.assertEquals('abc/def', self.get('remote', 'target'))
+         self.assertEqual('abc/def', self.get('remote', 'target'))
  
      @Fixture(home='home1.ini')
 -    def test_addconf(self):
 +    def test_addconf_pos1(self):
          '''value can be inherit from two levels'''
          self.add_conf(os.path.join(FILE_DIRNAME, 'testdata', 'ini',\
                                     'project1.ini'))
index 28dbee4b38292cdf37a31b64eed7c9db39751fef,a977439f00033af56f72115df9dbb103f8e26aba..6765640b9f25aa0bad5fbe9da595f3191c3f12d1
@@@ -1,15 -1,14 +1,15 @@@
 -"""Functionality tests for gbs export."""
 +"""Functionality tests for gbsexport."""
  
  import unittest
- import imp
+ from importlib.machinery import SourceFileLoader
  import os
  import shutil
  import tempfile
 -from nose.tools import eq_
 +from nose.tools import raises
 +from gitbuildsys.cmd_export import config_is_true
  
- GBS = imp.load_source("gbs", "./tools/gbs").main
+ GBS = SourceFileLoader("gbs", "./tools/gbs").load_module("gbs").main
  class TestExport(unittest.TestCase):
      """Test export output of gbs commands"""
  
index ea92f9e1b2139c8b9789f30c70abf229cf939a8d,76483ffee1a8382141a81e5f77a0b78aceef8cdc..f0b0711f06c2a94d475b520b9d145902e4b0fea6
  """Functionality tests for gbs help."""
  
  import unittest
- import imp
+ from importlib.machinery import SourceFileLoader
  
 -from nose.tools import eq_
  
- GBS = imp.load_source("gbs", "./tools/gbs").main
+ GBS = SourceFileLoader("gbs", "./tools/gbs").load_module("gbs").main
  class TestHelp(unittest.TestCase):
      """Test help output of gbs commands"""
  
                      "chroot", "chr"]:
  
              try:
-                 print('>>>sub', sub)
+                 print(('>>>sub', sub))
                  GBS(argv=["gbs", sub, "--help"])
              except SystemExit as err:
 -                eq_(err.code, 0)
 +                self.assertEqual(err.code, 0)
  
      @staticmethod
 -    def test_help():
 +    def test_help_pos1():
          """Test running gbs --help and gbs help."""
          try:
              GBS(argv=["gbs", "--help"])
Simple merge
index 77f33f11f6a055e6f9595397ec6b419547b00644,b7cb5399c6d4ca10241fc98c67fc9d755e899d4b..2d31baf9ac80f00d7d42408f7895e7390d1c2846
@@@ -117,20 -117,20 +117,20 @@@ repo1.passwdx = QlpoOTFBWSZTWYfNdxYAAAI
          reload(gitbuildsys.conf)
  
          pwd = gitbuildsys.conf.configmgr.get('passwd', 'remotebuild')
-         self.assertEquals('secret', pwd)
+         self.assertEqual('secret', pwd)
  
      @Fixture(home='plain_passwd.ini')
 -    def test_get_passwd(self, fake_open):
 +    def test_get_passwd_pos1(self, fake_open):
          'test get decode passwd'
          fake_open.return_value = FakeFile()
  
          reload(gitbuildsys.conf)
  
          pwd = gitbuildsys.conf.configmgr.get('passwd', 'remotebuild')
-         self.assertEquals('secret', pwd)
+         self.assertEqual('secret', pwd)
  
      @Fixture(home='bad_passwdx.ini')
 -    def test_bad_passwdx(self, _fake_open):
 +    def test_bad_passwdx_neg1(self, _fake_open):
          'test bad passwdx'
          reload(gitbuildsys.conf)
  
index 26493e22e0e60c5ebe3ded44dcddf84dce6f22d4,ff28d966cd21332a8508fdfb9c999fd4b9e51ef0..897f3df5ef57c2a000d6fec30bd564ec1107833e
@@@ -38,57 -38,57 +38,57 @@@ class ProfileStyleTest(unittest.TestCas
      '''Test for profile oriented config'''
  
      @Fixture(home='profile.ini')
 -    def test_profile_api(self):
 +    def test_profile_api_pos1(self):
          'test get obs api'
-         self.assertEquals('https://api.tz/path', get_profile().obs.url)
+         self.assertEqual('https://api.tz/path', get_profile().obs.url)
  
      @Fixture(home='profile.ini')
 -    def test_api_inherit_auth(self):
 +    def test_api_inherit_auth_pos1(self):
          'test api can inherit auto from parent profile section'
-         self.assertEquals('https://Alice:secret@api.tz/path',
+         self.assertEqual('https://Alice:secret@api.tz/path',
                            get_profile().obs.url.full)
  
      @Fixture(home='profile_only_has_api.ini')
 -    def test_api_auth_can_be_overwrite(self):
 +    def test_api_auth_can_be_overwrite_pos1(self):
          'test api auth can be overwrite'
-         self.assertEquals('https://Bob:classified@api.tz/path',
+         self.assertEqual('https://Bob:classified@api.tz/path',
                            get_profile().obs.url.full)
  
      @Fixture(home='profile.ini')
 -    def test_profile_repos_in_order(self):
 +    def test_profile_repos_in_order_pos1(self):
          'repos must be in same order as they are write in config'
-         self.assertEquals(['https://repo/ia32/main',
+         self.assertEqual(['https://repo/ia32/main',
                             'https://repo/ia32/non-oss',
                             'https://repo/ia32/base',
                             '/local/path'],
                            [i.url for i in get_profile().repos])
  
      @Fixture(home='profile.ini')
 -    def test_repo_inherit_auth(self):
 +    def test_repo_inherit_auth_pos1(self):
          'test repo can inherit auth from parent section'
-         self.assertEquals('https://Alice:secret@repo/ia32/main',
+         self.assertEqual('https://Alice:secret@repo/ia32/main',
                            get_profile().repos[0].url.full)
  
      @Fixture(home='profile.ini')
 -    def test_repo_overwrite_auth(self):
 +    def test_repo_overwrite_auth_pos1(self):
          'test repo auth can be overwrite'
-         self.assertEquals('https://Bob:classified@repo/ia32/base',
+         self.assertEqual('https://Bob:classified@repo/ia32/base',
                            get_profile().repos[2].url.full)
  
      @Fixture(home='bug387_inherit_only_user.ini')
 -    def test_inherit_only_user(self):
 +    def test_inherit_only_user_pos1(self):
          'test inherit only user from parent'
-         self.assertEquals('https://tester:secret@repo',
+         self.assertEqual('https://tester:secret@repo',
                            get_profile().repos[0].url.full)
-         self.assertEquals('https://tester:secret@obs',
+         self.assertEqual('https://tester:secret@obs',
                            get_profile().obs.url.full)
  
      @Fixture(home='bug387_inherit_only_passwdx.ini')
 -    def test_inherit_only_passwdx(self):
 +    def test_inherit_only_passwdx_pos1(self):
          'test inherit only password from parent'
-         self.assertEquals('https://tester:secret@repo',
+         self.assertEqual('https://tester:secret@repo',
                            get_profile().repos[0].url.full)
-         self.assertEquals('https://tester:secret@obs',
+         self.assertEqual('https://tester:secret@obs',
                            get_profile().obs.url.full)
  
      @Fixture(home='bug387_only_password_no_user.ini')
@@@ -97,9 -97,9 +97,9 @@@
          self.assertRaises(ConfigError, get_profile)
  
      @Fixture(home='bug387_inline_auth_has_the_highest_priority.ini')
 -    def test_inline_highest_priority(self):
 +    def test_inline_highest_priority_pos1(self):
          'test inline auth has the highest priority'
-         self.assertEquals('https://this:inline-pwd@obs',
+         self.assertEqual('https://this:inline-pwd@obs',
                            get_profile().obs.url.full)
  
      @Fixture(home='no_such_profile_section_name.ini')
          'test get a empty profile'
          profile = get_profile()
  
-         self.assertEquals(None, profile.obs)
-         self.assertEquals([], profile.repos)
+         self.assertEqual(None, profile.obs)
+         self.assertEqual([], profile.repos)
  
      @Fixture(home='profile.ini')
 -    def test_local_repo_need_not_auth(self):
 +    def test_local_repo_need_not_auth_neg1(self):
          '''test local path needn't auth info'''
-         self.assertEquals('/local/path', get_profile().repos[3].url.full)
+         self.assertEqual('/local/path', get_profile().repos[3].url.full)
  
      @Fixture(home='profile.ini')
 -    def test_obs_base_project(self):
 +    def test_obs_base_project_pos1(self):
          'test read base project from conf'
-         self.assertEquals('base', get_profile().obs.base)
+         self.assertEqual('base', get_profile().obs.base)
  
      @Fixture(home='profile.ini')
 -    def test_obs_target_project(self):
 +    def test_obs_target_project_pos1(self):
          'test read target project from conf'
-         self.assertEquals('target', get_profile().obs.target)
+         self.assertEqual('target', get_profile().obs.target)
  
  
  @patch('gitbuildsys.conf.open', MagicMock(), create=True)
@@@ -137,28 -137,28 +137,28 @@@ class SubcommandStyleTest(unittest.Test
      '''test for subcommand oriented config'''
  
      @Fixture(home='subcommand.ini')
 -    def test_api(self):
 +    def test_api_pos1(self):
          'test obs api'
-         self.assertEquals('https://api/build/server', get_profile().obs.url)
+         self.assertEqual('https://api/build/server', get_profile().obs.url)
  
      @Fixture(home='subcommand.ini')
 -    def test_api_auth(self):
 +    def test_api_auth_pos1(self):
          'test api auth'
-         self.assertEquals('https://Alice:secret@api/build/server',
+         self.assertEqual('https://Alice:secret@api/build/server',
                            get_profile().obs.url.full)
  
      @Fixture(home='subcommand.ini')
 -    def test_repos_in_order(self):
 +    def test_repos_in_order_pos1(self):
          'repos list must be in the same order as they are write in config'
-         self.assertEquals(['https://repo1/path',
+         self.assertEqual(['https://repo1/path',
                             'https://repo2/path',
                             '/local/path/repo'],
                            [i.url for i in get_profile().repos])
  
      @Fixture(home='subcommand.ini')
 -    def test_repo_auth(self):
 +    def test_repo_auth_pos1(self):
          'test repo auth'
-         self.assertEquals('https://Alice:secret@repo1/path',
+         self.assertEqual('https://Alice:secret@repo1/path',
                            get_profile().repos[0].url.full)
  
  
diff --cc tools/gbs
Simple merge