This module tests the logging.Logger instance returned by standard_logging.py with a variety of options and choices. These tests use the standard unittest package and extend the unittest.TestCase class.
module_version: | 1.0 |
---|---|
created_on: | 2013-04-08 |
Test the functions defined in standard_logging.py.
A standard logging.Logger instance is created from a call to standard_logging and then is tested with different sets of arguments.
Initialize the framework for testing.
Creates a new system temporary directory with the tempfile package as a place to generate our test log file, and generate a name for the test log file. Also generates argparse.ArgumentParser instance from standard_parsers.py, a fake command line and arguments.
Remove testing framework.
Deletes the created temporary directory and thisfileexists.txt file.
Test for graceful fail when not given required arguments
Test object | Expectation |
---|---|
no verbose argument | Raise AttributeError |
no log argument | Raise AttributeError |