utKit (class)

class utKit(moduleDirectory)[source]

Bases: object

Default setup for fundamentals style unit-testing workflow (all tests base on nose module)

Key Arguments

  • moduleDirectory – the directory to the unit-testing test file

Usage

To use this kit within any of your unit-test modules add the following code before your test methods:

from fundamentals.utKit import utKit
# SETUP AND TEARDOWN FIXTURE FUNCTIONS FOR THE ENTIRE MODULE
moduleDirectory = os.path.dirname(__file__)
utKit = utKit(moduleDirectory)
log, dbConn, pathToInputDir, pathToOutputDir = utKit.setupModule()
utKit.tearDownModule()

Methods

get_project_root()

Get the root of the ``python`` package - useful for getting files in the root directory of a project

refresh_database()

Refresh the unit test database

setupModule()

The setupModule method

tearDownModule()

The tearDownModule method

get_project_root()[source]

Get the root of the ``python`` package - useful for getting files in the root directory of a project

Return

  • rootPath – the root path of a project

refresh_database()[source]

Refresh the unit test database

setupModule()[source]

The setupModule method

Return

  • log – a logger

  • dbConn – a database connection to a test database (details from yaml settings file)

  • pathToInputDir – path to modules own test input directory

  • pathToOutputDir – path to modules own test output directory

tearDownModule()[source]

The tearDownModule method

Key Arguments

=

Return

  • None