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'))
'''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')
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)
'''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)