示例#1
0
def test_file_download_error_response(test_client):
    """
    download_file
    """
    context = test_client[3]

    with context:
        # bad file name
        result = persistent_download("not there")
        assert result.status_code == 404

        # bad file token
        result = tmp_download("bad_file_token")
        assert result.status_code == 400

        # expired file
        result = tmp_download(str(uuid.uuid1()))
        assert result.status_code == 404
示例#2
0
def test_get_search_expressions_slice_by_feature_id_json(test_client):
    """
    get_search_expressions
    """
    context = test_client[3]

    with context:
        # feature ID list (200)
        result, code = operations.get_search_expressions(
            featureIDList=['ENSG00000000003', 'ENSG00000000005'], format='json')
        assert len(result) == 1
        assert result[0]['fileType'] == 'json'
        assert code == 200
        tmp_id = result[0]['id']
        tmp_response = tmp_download(str(tmp_id))
        assert tmp_response.status_code == 200