Changeset 0b3733d in mod_gnutls


Ignore:
Timestamp:
Jan 5, 2020, 3:54:18 AM (6 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master, proxy-ticket
Children:
1fe7cac
Parents:
bdf5917
Message:

Test suite: Support checking absence of headers

Location:
test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/tests.py

    rbdf5917 r0b3733d  
    6969        # variables in the value.
    7070        Content-Type: 'text/plain; charset=ISO-8859-1'
     71        # You can check the absence of a header by expecting null:
     72        X-Forbidden-Header: null
    7173      body:
    7274        # All strings in this list must occur in the body, in any
     
    466468    'abcdef'
    467469
     470    Referencing undefined environment variables causes a KeyError.
     471
     472    >>> subst_env('${EXAMPLE_UNSET}')
     473    Traceback (most recent call last):
     474    ...
     475    KeyError: 'EXAMPLE_UNSET'
     476
     477    >>> subst_env(None) is None
     478    True
     479
    468480    """
     481    if not text:
     482        return None
    469483    t = Template(text)
    470484    return t.substitute(os.environ)
  • test/sample_test.yml

    rbdf5917 r0b3733d  
    2323      headers:
    2424        Content-Type: 'text/plain; charset=ISO-8859-1'
     25        X-Forbidden-Header: null
    2526      body:
    2627        contains:
Note: See TracChangeset for help on using the changeset viewer.