Package test_suite :: Module formatting
[hide private]
[frames] | no frames]

Module formatting

source code

Functions [hide private]
 
divider(char, width=100)
Write out a divider of the given width.
source code
 
format_test_name(test_name, category=None)
Generate the compact string representation of the test name.
source code
 
subtitle(text)
Function for printing the subtitles.
source code
 
summary_line(name, passed, width=100)
Print a summary line.
source code
 
test_title(name, desc=None, width=100)
Format and write out a title for the test.
source code
 
title(text)
Function for printing the titles.
source code
Variables [hide private]
  __package__ = 'test_suite'

Imports: sys, wrap


Function Details [hide private]

divider(char, width=100)

source code 

Write out a divider of the given width.

Parameters:
  • char (str) - The character to use for the divider.
  • width (int) - The number of characters to use.

format_test_name(test_name, category=None)

source code 

Generate the compact string representation of the test name.

Parameters:
  • test_name (str) - The original TestCase name.
  • category (str) - The test category, one of 'system', 'unit', 'gui', or 'verification'.

subtitle(text)

source code 

Function for printing the subtitles.

Parameters:
  • text (str) - The text of the subtitle to be printed.

summary_line(name, passed, width=100)

source code 

Print a summary line.

Parameters:
  • name (str) - The name of the test, test category, etc.
  • passed (bool or str) - An argument which if True causes '[ OK ]' to be printed and if False causes '[ Failed ]' to be printed. The special string 'skip' is used to indicate that this has been skipped.
  • width (int) - The width of the line, excluding the terminal '[ OK ]' or '[ Failed ]'.

test_title(name, desc=None, width=100)

source code 

Format and write out a title for the test.

Parameters:
  • name (str) - The name of the test.
  • desc (str) - An optional description for the test.
  • width (int) - The console width.

title(text)

source code 

Function for printing the titles.

Parameters:
  • text (str) - The text of the title to be printed.