Example #1
0
 def test_auth_fails(self, session):
     result = session.app.post(
         '/binaries/ceph/giant/ceph/el6/x86_64/ceph-9.0.0-0.el6.x86_64.rpm/',
         upload_files=[('file', 'ceph-9.0.0-0.el6.x86_64.rpm', 'hello tharrrr')],
         headers={'Authorization': util.make_credentials(correct=False)},
         expect_errors=True
     )
     assert result.status_int == 401
Example #2
0
 def test_auth_fails(self, session, url):
     result = session.app.post(
         url,
         upload_files=[('file', 'ceph-9.0.0-0.el6.x86_64.rpm',
                        b_('hello tharrrr'))],
         headers={'Authorization': util.make_credentials(correct=False)},
         expect_errors=True)
     assert result.status_int == 401
Example #3
0
 def head(self, url, **kwargs):
     """
     @param (string) url - The URL to emulate a HEAD request to
     @returns (paste.fixture.TestResponse)
     """
     if not kwargs.get('headers'):
         kwargs['headers'] = {'Authorization': util.make_credentials()}
     return self._do_request(url, 'HEAD', **kwargs)
Example #4
0
 def head(self, url, **kwargs):
     """
     @param (string) url - The URL to emulate a HEAD request to
     @returns (paste.fixture.TestResponse)
     """
     if not kwargs.get('headers'):
         kwargs['headers'] = {'Authorization': util.make_credentials()}
     return self._do_request(url, 'HEAD', **kwargs)
Example #5
0
 def post(self, url, **kwargs):
     """
     @param (string) url - The URL to emulate a POST request to
     @returns (paste.fixture.TestResponse)
     """
     # support automatic, correct authentication if not specified otherwise
     if not kwargs.get('headers'):
         kwargs['headers'] = {'Authorization': util.make_credentials()}
     return self._do_request(url, 'POST', **kwargs)
Example #6
0
 def post(self, url, **kwargs):
     """
     @param (string) url - The URL to emulate a POST request to
     @returns (paste.fixture.TestResponse)
     """
     # support automatic, correct authentication if not specified otherwise
     if not kwargs.get('headers'):
         kwargs['headers'] = {'Authorization': util.make_credentials()}
     return self._do_request(url, 'POST', **kwargs)