Пример #1
0
 def test_get_server_info_with_site(self):
     """Testing the GET info/ API with a local site"""
     self._login_user(local_site=True)
     rsp = self.apiGet(get_server_info_url(self.local_site_name),
                       expected_mimetype=server_info_mimetype)
     self.assertEqual(rsp['stat'], 'ok')
     self.assertTrue('info' in rsp)
     self.assertTrue('product' in rsp['info'])
     self.assertTrue('site' in rsp['info'])
Пример #2
0
 def test_get_server_info_with_site(self):
     """Testing the GET info/ API with a local site"""
     self._login_user(local_site=True)
     rsp = self.apiGet(get_server_info_url(self.local_site_name),
                       expected_mimetype=server_info_mimetype)
     self.assertEqual(rsp['stat'], 'ok')
     self.assertTrue('info' in rsp)
     self.assertTrue('product' in rsp['info'])
     self.assertTrue('site' in rsp['info'])
Пример #3
0
    def test_get_server_info(self):
        """Testing the GET info/ API"""
        rsp = self.apiGet(get_server_info_url(),
                          expected_mimetype=server_info_mimetype)
        self.assertEqual(rsp['stat'], 'ok')
        self.assertTrue('info' in rsp)
        self.assertTrue('product' in rsp['info'])
        self.assertTrue('site' in rsp['info'])
        self.assertTrue('capabilities' in rsp['info'])

        caps = rsp['info']['capabilities']
        self.assertTrue('diffs' in caps)

        diffs_caps = caps.get('diffs')
        self.assertTrue(diffs_caps.get('moved_files', False))
        self.assertTrue(diffs_caps.get('base_commit_ids', False))
Пример #4
0
    def test_get_server_info(self):
        """Testing the GET info/ API"""
        rsp = self.apiGet(get_server_info_url(),
                          expected_mimetype=server_info_mimetype)
        self.assertEqual(rsp['stat'], 'ok')
        self.assertTrue('info' in rsp)
        self.assertTrue('product' in rsp['info'])
        self.assertTrue('site' in rsp['info'])
        self.assertTrue('capabilities' in rsp['info'])

        caps = rsp['info']['capabilities']
        self.assertTrue('diffs' in caps)

        diffs_caps = caps.get('diffs')
        self.assertTrue(diffs_caps.get('moved_files', False))
        self.assertTrue(diffs_caps.get('base_commit_ids', False))
Пример #5
0
 def setup_basic_get_test(self, user, with_local_site, local_site_name):
     return (get_server_info_url(local_site_name),
             server_info_mimetype,
             None)
Пример #6
0
 def setup_http_not_allowed_item_test(self, user):
     return get_server_info_url()
Пример #7
0
 def test_get_server_info_with_site_no_access(self):
     """Testing the GET info/ API with a local site and Permission Denied error"""
     self.apiGet(get_server_info_url(self.local_site_name),
                 expected_status=403)
Пример #8
0
 def setup_basic_get_test(self, user, with_local_site, local_site_name):
     return (get_server_info_url(local_site_name),
             server_info_mimetype,
             None)
Пример #9
0
 def setup_http_not_allowed_item_test(self, user):
     return get_server_info_url()
Пример #10
0
 def test_get_server_info_with_site_no_access(self):
     """Testing the GET info/ API with a local site and Permission Denied error"""
     self.apiGet(get_server_info_url(self.local_site_name),
                 expected_status=403)