def _compare_item(self, item_rsp, hosting_service):
    self.assertEqual(item_rsp['id'], hosting_service.id)
    self.assertEqual(item_rsp['name'], hosting_service.name)
    self.assertEqual(item_rsp['needs_authorization'],
                     hosting_service.needs_authorization)
    self.assertEqual(item_rsp['supports_bug_trackers'],
                     hosting_service.supports_bug_trackers)
    self.assertEqual(item_rsp['supports_repositories'],
                     hosting_service.supports_repositories)
    self.assertEqual(item_rsp['supports_two_factor_auth'],
                     hosting_service.supports_two_factor_auth)
    self.assertEqual(item_rsp['supported_scmtools'],
                     hosting_service.supported_scmtools)

    # Compute the base URL for links.
    url_base = 'http://testserver/'

    if '/s/local-site-1/' in item_rsp['links']['self']['href']:
        url_base += 's/local-site-1/'

    url_base += 'api/'

    # Check the links.
    accounts_url = url_base + ('hosting-service-accounts/?service=%s'
                               % hosting_service.id)
    self.assertIn('accounts', item_rsp['links'])
    self.assertEqual(item_rsp['links']['accounts']['href'], accounts_url)

    accounts_url = url_base + ('repositories/?hosting-service=%s'
                               % hosting_service.id)
    self.assertIn('repositories', item_rsp['links'])
    self.assertEqual(item_rsp['links']['repositories']['href'], accounts_url)
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/webapi/tests/test_hosting_service.py/_compare_item/original