semvec/pypi-packages huggingface dataset:
pytest-helper 0.2.2
Functions to help in using the pytest testing framework
License: MIT
Keywords: pytest

.. default-role:: code

pytest-helper
=============

The pytest-helper package provides several functions which make it easier to
set up and run unit tests in Python using the `pytest <http://pytest.org>`_
testing framework.  For example, there is a function to make modules
self-testing whenever they are executed as scripts, and a function to simplify
making modifications to the Python search path.  One of the most useful
features is that relative pathnames are relative to the directory of the file
in which they occur (i.e., not relative to the CWD).  This package makes use of
pytest but is independent of the official pytest project.

For examples and full documentation, see https://abarker.github.io/pytest-helper
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The easiest way to install is to install from PyPI using pip:

.. code-block:: bash

   pip install pytest-helper
Flask-CasLite 0.0.1
cas client
License: MIT
Keywords: flask extension development

# Flask-CasLite

cas client


## Install


```

pip install Flask-CasLite

```


## Example

```python

from flask import Flask, session, request
from flask_caslite import CasLite, login_required, handle_logout



app = Flask(__name__)
app.config.update(
    SECRET_KEY = 'hello',
    CAS_SERVER = 'https://sso.atbyd.com/cas',
    CAS_VERSION = 'v2',
    CAS_TOKEN_SESSION_KEY = '_CAS_TOKEN',
    CAS_USERNAME_SESSION_KEY = 'CAS_USERNAME',
    CAS_ATTRIBUTES_SESSION_KEY = 'CAS_ATTRIBUTES'
)

CasLite(app)


@app.before_request
def handle_cas_logout():
    print(handle_logout(request))


@app.route('/', methods=['GET'])
def index():
    session['hello'] ='world'
    return 'Hello, World'

@app.route('/private_page/', methods=['GET'])
@login_required
def cas():
    cas_user =session.get('CAS_USERNAME')
    return 'Hello, ' + cas_user + session.get('hello','')


if __name__ == "__main__":
    app.run(debug=True,host='0.0.0.0')

```