How to use the locustio.common_utils.NO_TOKEN_HEADERS function in locustio

To help you get started, we’ve selected a few locustio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atlassian / dc-app-performance-toolkit / app / locustio / jira / http_actions.py View on Github external
locust.client.post('/rest/issueNav/latest/preferredSearchLayout', params={'layoutKey': 'split-view'},
                       headers=NO_TOKEN_HEADERS, catch_response=True)

    locust.client.post('/rest/webResources/1.0/resources', params.resources_body.get("320"),
                       TEXT_HEADERS, catch_response=True)
    r = locust.client.post('/rest/issueNav/1/issueTable', data=params.issue_table_payload,
                           headers=NO_TOKEN_HEADERS, catch_response=True)
    content = r.content.decode('utf-8')
    issue_ids = re.findall(params.ids_pattern, content)

    locust.client.post('/rest/webResources/1.0/resources', params.resources_body.get("330"),
                       TEXT_HEADERS, catch_response=True)
    if issue_ids:
        body = params.prepare_jql_body(issue_ids)
        r = locust.client.post('/rest/issueNav/1/issueTable/stable', data=body,
                               headers=NO_TOKEN_HEADERS, catch_response=True)
        content = r.content.decode('utf-8')
        issue_key = fetch_by_re(params.issue_key_pattern, content)
        issue_id = fetch_by_re(params.issue_id_pattern, content)
    locust.client.post('/secure/QueryComponent!Jql.jspa', params={'jql': 'order by created DESC',
                                                                  'decorator': None}, headers=TEXT_HEADERS,
                       catch_response=True)
    locust.client.post('/rest/orderbycomponent/latest/orderByOptions/primary',
                       data={"jql": "order by created DESC"}, headers=TEXT_HEADERS, catch_response=True)
    if issue_ids:
        r = locust.client.post('/secure/AjaxIssueAction!default.jspa', params={"decorator": None,
                                                                               "issueKey": issue_key,
                                                                               "prefetch": False,
                                                                               "shouldUpdateCurrentProject": False,
                                                                               "loadFields": False,
                                                                               "_": timestamp_int()},
                               headers=TEXT_HEADERS, catch_response=True)
github atlassian / dc-app-performance-toolkit / app / locustio / confluence / http_actions.py View on Github external
def comment_page(locust):
    page = random.choice(confluence_dataset["pages"])
    page_id = page[0]
    comment = f'<p>{generate_random_string(length=15, only_letters=True)}</p>'
    uid = str(uuid.uuid4())
    r = locust.client.post(f'/rest/tinymce/1/content/{page_id}/comment?actions=true',
                           params={'html': comment, 'watch': True, 'uuid': uid}, headers=NO_TOKEN_HEADERS,
                           catch_response=True)
    content = r.content.decode('utf-8')
    if not('reply-comment' in content and 'edit-comment' in content):
        logger.error(f'Could not add comment: {content}')
    assert 'reply-comment' in content and 'edit-comment' in content, 'Could not add comment.'
github atlassian / dc-app-performance-toolkit / app / locustio / jira / http_actions.py View on Github external
params = SearchJql()
    jql = random.choice(jira_dataset['jqls'])[0]

    r = locust.client.get(f'/issues/?jql={jql}', catch_response=True)
    content = r.content.decode('utf-8')
    if not (locust.atl_token in content):
        logger.error(f'Can not search by {jql}: {content}')
    assert locust.atl_token in content, 'Can not search by jql'

    locust.client.post('/rest/webResources/1.0/resources', params.resources_body.get("305"),
                       TEXT_HEADERS, catch_response=True)

    locust.client.get(f'/rest/api/2/filter/favourite?expand=subscriptions[-5:]&_={timestamp_int()}',
                      catch_response=True)
    locust.client.post('/rest/issueNav/latest/preferredSearchLayout', params={'layoutKey': 'split-view'},
                       headers=NO_TOKEN_HEADERS, catch_response=True)

    locust.client.post('/rest/webResources/1.0/resources', params.resources_body.get("320"),
                       TEXT_HEADERS, catch_response=True)
    r = locust.client.post('/rest/issueNav/1/issueTable', data=params.issue_table_payload,
                           headers=NO_TOKEN_HEADERS, catch_response=True)
    content = r.content.decode('utf-8')
    issue_ids = re.findall(params.ids_pattern, content)

    locust.client.post('/rest/webResources/1.0/resources', params.resources_body.get("330"),
                       TEXT_HEADERS, catch_response=True)
    if issue_ids:
        body = params.prepare_jql_body(issue_ids)
        r = locust.client.post('/rest/issueNav/1/issueTable/stable', data=body,
                               headers=NO_TOKEN_HEADERS, catch_response=True)
        content = r.content.decode('utf-8')
        issue_key = fetch_by_re(params.issue_key_pattern, content)