<commit_before># PMC Math Tool 2 tests

# When composing the request, any parameter not given here will be absent in the
# request. If request.example is given, then that example file will be read, and
# stuffed into request.q. Default request.method is 'POST'.
# Defaults:
#   request.method: POST
#   expected.code: 200
#   expected.content-type: 'image/svg+xml; charset=utf-8'


# GET request with no params, should get the test page
- name: test-page
  request:
    method: GET
  expected:
    content-type: 'text/html; charset=utf-8'
    content-contains: "PMC Math Tool 2"

# GET request with some bad params
- name: bad-get-params
  request:
    method: GET
    foo: bar
    baz: buzz
  expected:
    code: 400
    content-type: 'text/plain; charset=utf-8'
    content-contains: "Unrecognized parameter name"

# POST request with no params, should get an error
- name: bad-post-no-params
  expected:
    code: 400
    content-type: 'text/plain; charset=utf-8'
    content-contains: "No source math detected in input"

# POST request with some bad params<commit_msg>Update test to reflect recent changes<commit_after># PMC Math Tool 2 tests

# When composing the request, any parameter not given here will be absent in the
# request. If request.example is given, then that example file will be read, and
# stuffed into request.q. Default request.method is 'POST'.
# Defaults:
#   request.method: POST
#   expected.code: 200
#   expected.content-type: 'image/svg+xml; charset=utf-8'


# GET request with no params, should get the test page
- name: test-page
  request:
    method: GET
  expected:
    content-type: 'text/html; charset=utf-8'
    content-contains: "Render Math"

# GET request with some bad params
- name: bad-get-params
  request:
    method: GET
    foo: bar
    baz: buzz
  expected:
    code: 400
    content-type: 'text/plain; charset=utf-8'
    content-contains: "Unrecognized parameter name"

# POST request with no params, should get an error
- name: bad-post-no-params
  expected:
    code: 400
    content-type: 'text/plain; charset=utf-8'
    content-contains: "No source math detected in input"

# POST request with some bad params
{'fraction_non_alphanumeric': 0.09426987060998152, 'fraction_numerical': 0.013401109057301294, 'mean_word_length': 3.4183673469387754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3332968', 'n_tokens_mistral': 694, 'n_tokens_neox': 650, 'n_words': 256}