Testing gracedb-client
======================
*Last updated 2 Aug 2017*

General information
-------------------
The default GraceDB service for tests is at https://gracedb-test.ligo.org/api/
To change this, you can add 

    TEST_SERVICE={url}

to the beginning of any of the above commands. Or, you can set TEST_SERVICE
in your environment and then run these commands:

    export TEST_SERVICE={url}

To use custom test data, set TEST_DATA_DIR. (see test.py and test.sh
for more info about test data)

Python client unit tests
------------------------
The "main" unit tests are in test.py - these are a set of well-rounded unit tests which test
different capabilities of the Python client.  More specific tests are in separate files.
Currently, we have:
    test_labels.py
    test_voevents.py

You can run ALL unit tests by doing:
    python test.py

You can run individual unit tests by doing either of the following(using voevents an example):
    python test.py voevents
    python test_voevents.py

Run 'python test.py --help' for slightly more information.

NOTE: If you aren't using a virtualenv, go to the root of this repository and run:
    PYTHONPATH=. python ligo/gracedb/test/test.py

Command-line interface unit tests
---------------------------------
If using a virtualenv with ligo-gracedb installed:
    ./test.sh

Otherwise, go to the root of this repository and run:
    PYTHONPATH=. GRACEDB='python bin/gracedb' ligo/gracedb/test/test.sh 

    This seems to work too:
        PYTHONPATH=. GRACEDB=bin/gracedb ligo/gracedb/test/test.sh 

