Package jsondata :: Module Selftest
[hide private]
[frames] | no frames]

Module Selftest

source code

Test of basic features for the user by '--selftest'.

This module is used by 'jsondc' when the opverify_data_schemaardoced basic functional checks by calling 'runselftest'.

The display of actions and results could be activated and raised by multiple repetition of the '-v' option.

The following data and schema are applied:

  1. jsondata/data.json + jsondata/schema.jsd
  2. jsondata/datacheck.json + jsondata/datacheck.jsd

The performed process flow is:

  1. load
  2. validate
  3. verify

By default either 'True' is returned, or in case of a failed test and/or error condition an exception is raised.


Version: 0.2.12

Author: Arno-Can Uestuensoez

Copyright: Copyright (C) 2015-2016 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez

License: Artistic-License-2.0 + Forced-Fairplay-Constraints

Functions [hide private]
 
runselftest(appname='selftest', **kargs)
Performs the selftest returns True or False.
source code
 
printverbose(lvl, args) source code
 
load_data(appname)
Loads and verifies the self test 'data.json'.
source code
 
load_appname(appname)
Loads and verifies the self test 'selftest.json'.
source code
 
verify_data_schema(appname)
Loads and validates the self test 'data.json' and 'schema.jsd'.
source code
 
verify_appname_schema(appname)
Loads and validates the self test 'selftest.json' and 'selftest.jsd'.
source code
 
jsonpointer_data_schema(appname)
Loads and verifies by using JSONPointer access 'data.json'.
source code
 
jsonpointer_selftest_data(appname)
Loads and verifies by using JSONPointer access 'selftest.json'.
source code
 
jsonpointer_selftest_data_schema(appname)
Loads and verifies by using JSONPointer access 'selftest.json'.
source code
Variables [hide private]
  __uuid__ = '63b597d6-4ada-4880-9f99-f5e0961351fb'
  _APPNAME = 'selftest'
  _interactive = False
  debug = False
  _verbose = 0
  __package__ = 'jsondata'
Function Details [hide private]

runselftest(appname='selftest', **kargs)

source code 
Performs the selftest returns True or False.
Executes some the basic runtime test cases for user verification.

Args:
    appname: Name of the application. Changing this may break the
        selftest.
        default:=selftest

    **kargs:
        debug: Displays extended state data for developers.
            Requires __debug__==True.
        verbose: Extends the amount of the display of 
            processing data.
        _verbose=#levels: Extends the amount of the display 
            of processing data by given number of levels
            at once.

Returns:
    Selftest object.

Raises:
    bypassed subsystems

load_data(appname)

source code 

Loads and verifies the self test 'data.json'.

Therefore the result of the creation of JSONDataSerializer is compared to the load by json.load().

load_appname(appname)

source code 

Loads and verifies the self test 'selftest.json'.

Therefore the result of the creation of JSONDataSerializer is compared to the load by json.load().

verify_data_schema(appname)

source code 

Loads and validates the self test 'data.json' and 'schema.jsd'.

Therefore the result of the creation of JSONDataSerializer is performed with draft3 validation by jsonschema.validate().

verify_appname_schema(appname)

source code 

Loads and validates the self test 'selftest.json' and 'selftest.jsd'.

Therefore the result of the creation of JSONDataSerializer is performed with draft3 validation by jsonschema.validate().