Previous topic

Addons

Next topic

Case

This Page

Base

Module: base

Author: arjs.net

License: http://opensource.org/licenses/mit-license.html; year=2013,2014; copyright holders=arjs.net

Module for the test base

class base.Base(bpath, rpath)

Base: Some basic stuff for handling the tests

__init__(bpath, rpath)
Parameters:
  • bpath (str) – Test base path
  • rpath (str) – Runner base path
Return type:

Base

Raises EnvironmentError:
 

criticalerror(test)
Parameters:test (str) – Test name
Return type:None

Terminate the test when an error is too critical to continue

failed(test, comment='', skipcapture=False)
Parameters:
  • test (str) – Test name
  • comment (str) – Optional comment
  • skipcapture (bool) – Optional screenshot
Returns:

Return type:

bool

Fail the test and take an optional screenshot

handlefindfailed(test)
Parameters:test (str) – Test name
Return type:bool

Determine whether or not to terminate the test after an error

Raises SystemExit:
 
passed(test, comment='', skipcapture=False)
Parameters:
  • test (str) – Test name
  • comment (str) – Optional comment
  • skipcapture (bool) – Optional screenshot
Returns:

Return type:

bool

Pass the test and do an optional screenshot

processconfig(config, configfile)
Parameters:
  • config (ConfigParser.RawConfigParser) – Configparser object
  • configfile (str) – file with configs
Return type:

None

Process the config values from a config file

starttimer()
Return type:None

Set the current start time

stoptimer()
Return type:None

Set the current end time

takescreenshot(status, stamp)
Parameters:
  • status (str) – Status to add
  • stamp (str) – Timestamp to add
Return type:

None

Takes a screenshot of the entire screen

timerdiff
Return type:str
Returns:

Return the difference of the timers

timestamp
Return type:str
Returns:

Get a timestamp

writecsvfile(comment, stamp, status, test)
Parameters:
  • comment (str) – Comment
  • stamp (str) – Timestamp
  • status (str) – Status
  • test (str) – Test name
Return type:

None

Write the log string to the csv file

base.checkconfigvalue(config, section, name)
Parameters:
  • config (ConfigParser.RawConfigParser) – Configparser object
  • section (str) – Section name
  • name (str) – Config name
Returns:

Return type:

bool

Check if a config name in a section exists

base.createdirectory(path)
Parameters:path (str) – path to create
Return type:object

Create a path