---------------------------------------------------------------------------
This directory contains unit and regression tests for the Librarian.
---------------------------------------------------------------------------

For unit testing the built in python "unittest" framework will be used.

To write a unit test for a given module/file creat a new file in
this directory using the module/file name and prefix it with "test_".

For example, to write a unit test for "book_register.py" you would
create a new file name "test_book_register.py", include the following:

    #!/usr/bin/python3

    import unittest
    import configparser

    from <module_to_test> import <class|function>

    class Test<class|function>(unittest.TestCase):
        def setUp(self):
            # setup code here

        def tearDown(self):
            # tear down code here

        def test_<class|function>_<seq#>(self):
            # unit test code here

    if __name__ == '__main__':
        unittest.main()

Reference: https://docs.python.org/3.4/library/unittest.html#module-unittest

# Run all the tests for a given module/file
$ python3 -m unittest tests.test_book_register

# Run all tests for a given class/function
$ python3 -m unittest tests.test_book_register.TestLoadConfig

# Run a specfic test for a given class/function
$ python3 -m unittest tests.test_book_register.TestLoadConfig.test_load_config_1

---------------------------------------------------------------------------

Automated pep8 checking for python files has been implemented in the
test_code_format_pep8.py test file. It requires the "pep8" module:

    $ sudo pip3 install pep8

Run from the top level git directory:

    $ python3 -m unittest tests.test_code_format_pep8

We are currently ignoring E201 and E202, this is noted in the unit test above
and also in the setup.cfg in case pep8 is run manually from the top level git
directory.

    $ pep8 -v <file_name.py>

---------------------------------------------------------------------------

Regression testing

rw_test.py - open shelf read/write/verify data using file and mmap operations
check-book.py - read/write/read/verify books on a shelf

---------------------------------------------------------------------------

mmap(2) stress testing with maptrap

Compile maptrap.c per the comment at the start of the file.  It has
many options for multithreaded, multistride, R/W, private/shared,
pause or free-run, sizing....
