@responses.activate
def test_connection_filename_in_header(self):
    build_id = '1234'
    filename = 'source.tar.gz'
    scm_url = f'https://code.example.com/{filename};sf=tgz'
    content = b'abc'
    reader = BufferedReader(BytesIO(content), buffer_size=1)
    get_scm_archive_request_url = ((PNC_BASE_API_URL + '/') + PNC_GET_SCM_ARCHIVE_PATH)
    responses.add(responses.GET, get_scm_archive_request_url.format(build_id), body=reader, status=302, headers={'Location': scm_url})
    responses.add(responses.HEAD, scm_url, body='', status=200, headers={'Content-disposition': f'filename="{filename}"'})
    pnc_util = PNCUtil(mock_pnc_map())
    (url, dest_filename) = pnc_util.get_scm_archive_from_build_id(build_id)
    assert (url == scm_url)
    assert (dest_filename == filename)
@responses.activate
def test_connection_filename_in_header(self):
    build_id = '1234'
    filename = 'source.tar.gz'
    scm_url = f'https://code.example.com/{filename};sf=tgz'
    content = b'abc'
    reader = BufferedReader(BytesIO(content), buffer_size=1)
    get_scm_archive_request_url = ((PNC_BASE_API_URL + '/') + PNC_GET_SCM_ARCHIVE_PATH)
    responses.add(responses.GET, get_scm_archive_request_url.format(build_id), body=reader, status=302, headers={'Location': scm_url})
    responses.add(responses.HEAD, scm_url, body=, status=200, headers={'Content-disposition': f'filename="{filename}"'})
    pnc_util = PNCUtil(mock_pnc_map())
    (url, dest_filename) = pnc_util.get_scm_archive_from_build_id(build_id)
    assert (url == scm_url)
    assert (dest_filename == filename)