<commit_before>Feature: As a user, I can customize verb, header and send a request body

@http
Scenario: Send a specific header
Given cabot
When I run "cabot http://127.0.1:8000/echo -H 'Header-Name: whynot'"
Then the status code is "0"
And stdout display
    """
    CONTENT_TYPE: text/plain
    HTTP_CONNECTION: close
    HTTP_HEADER_NAME: whynot
    HTTP_HOST: localhost
    HTTP_USER_AGENT: cabot/0.4.0
    PATH_INFO: /echo
    REQUEST_METHOD: GET
    """
And stderr is empty

@http
Scenario: Send multiple specific header
Given cabot
When I run "cabot http://127.0.1:8000/echo -H 'Header-Name: A' -H 'Header-Name: B' -H 'Header-Other: C'"
Then the status code is "0"
And stdout display
    """
    CONTENT_TYPE: text/plain
    HTTP_CONNECTION: close
    HTTP_HEADER_NAME: A,B
    HTTP_HEADER_OTHER: C
    HTTP_HOST: localhost
    HTTP_USER_AGENT: cabot/0.4.0
    PATH_INFO: /echo
    REQUEST_METHOD: GET
    """
And stderr is empty

@http
Scenario: Send header and body
Given cabot
When I run "cabot http://127.0.1:8000/echo -X POST -H 'Content-Type: application/json' -d '{"a": "b"}'"
Then the status code is "0"
And stdout display
    """
    CONTENT_LENGTH: 10
    CONTENT_TYPE: application/json
    HTTP_CONNECTION: close
    HTTP_HOST: localhost
    HTTP_USER_AGENT: cabot/0.4.0
    PATH_INFO: /echo
    REQUEST_METHOD: POST
    body: {"a": "b"}
    """
And stderr is empty<commit_msg>Add a tests for the -A option<commit_after>Feature: As a user, I can customize verb, header and send a request body

@http
Scenario: Send a specific header
Given cabot
When I run "cabot http://127.0.1:8000/echo -H 'Header-Name: whynot'"
Then the status code is "0"
And stdout display
    """
    CONTENT_TYPE: text/plain
    HTTP_CONNECTION: close
    HTTP_HEADER_NAME: whynot
    HTTP_HOST: localhost
    HTTP_USER_AGENT: cabot/0.4.0
    PATH_INFO: /echo
    REQUEST_METHOD: GET
    """
And stderr is empty

@http
Scenario: Send multiple specific header
Given cabot
When I run "cabot http://127.0.1:8000/echo -H 'Header-Name: A' -H 'Header-Name: B' -H 'Header-Other: C'"
Then the status code is "0"
And stdout display
    """
    CONTENT_TYPE: text/plain
    HTTP_CONNECTION: close
    HTTP_HEADER_NAME: A,B
    HTTP_HEADER_OTHER: C
    HTTP_HOST: localhost
    HTTP_USER_AGENT: cabot/0.4.0
    PATH_INFO: /echo
    REQUEST_METHOD: GET
    """
And stderr is empty

@http
Scenario: Send header and body
Given cabot
When I run "cabot http://127.0.1:8000/echo -X POST -H 'Content-Type: application/json' -d '{"a": "b"}'"
Then the status code is "0"
And stdout display
    """
    CONTENT_LENGTH: 10
    CONTENT_TYPE: application/json
    HTTP_CONNECTION: close
    HTTP_HOST: localhost
    HTTP_USER_AGENT: cabot/0.4.0
    PATH_INFO: /echo
    REQUEST_METHOD: POST
    body: {"a": "b"}
    """
And stderr is empty

@http
Scenario: Send custom user agent
Given cabot
When I run "cabot http://127.0.1:8000/echo -A Mozilla/5.0"
Then the status code is "0"
And stdout display
    """
    CONTENT_TYPE: text/plain
    HTTP_CONNECTION: close
    HTTP_HOST: localhost
    HTTP_USER_AGENT: Mozilla/5.0
    PATH_INFO: /echo
    REQUEST_METHOD: GET
    """
And stderr is empty
{'fraction_non_alphanumeric': 0.102880658436214, 'fraction_numerical': 0.030389363722697058, 'mean_word_length': 3.2302543507362786, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3518471', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1110, 'n_words': 363}