| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
JsonHelper
Functions for modifying and validating JSON data
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
Compares two JSON values If parameter validate_order is True, position of keys is taken into account during validation If json1 or json2 are strings, it must be a valid JSON string
|
Compares two JSON values, ignoring position of keys If json1 or json2 are strings, it must be a valid JSON string
|
Compares two JSON values, taking into account key order If json1 or json2 are strings, it must be a valid JSON string
|
Takes two dictionaries, compares and displays any distinct keys in both, matching keys but different values, matching key/values
@param dictA: dictionary or tuple (for e.g. expected dictionary)
@type dictA: dictionary
@param dictB: dictionary or tuple (for e.g. dictionary captured at run time)
@type dictA: dictionary
e.g. Tuple: dictA = {Dictionary1, Dictionary2, Dictionary3} = {'city': ['montreal'], 'ln': ['en']}, {'drink': ['water'], 'weather': ['rainy']}, {'device': ['iPad']}
dictB = {Dictionary1, Dictionary2, Dictionary3} = {'city': ['montreal'], 'ln': ['fr'], 'color':['blue']}, {'drink': ['alcohol'], 'weather': ['rainy']}, {'device': ['iPad']}
Output: (prints only the non matching dictionaries with the differences)
> assert False, '
'.join(nonmatching_dict)
E AssertionError:
E
E Dictionary_1
E distinct_tags_in_dict_1A: None
E distinct_tags_in_dict_1B: {color:['blue']}
E nonmatching_tags_in_two_dicts:{ln:['en']} & {ln:['fr']} respectively
E matching_tags_in_two_dicts:{city:['montreal']}
E
E
E Dictionary_2
E distinct_tags_in_dict_2A: None
E distinct_tags_in_dict_2B: None
E nonmatching_tags_in_two_dicts:{drink:['water']} & {drink:['alcohol']} respectively
E matching_tags_in_two_dicts:{weather:['rainy']}
|
Takes a dictionary or a list and removes keys specified by 'keys' parameter
|
Takes a dictionary or a list and removes keys specified by 'keys' parameter
|
" Applies a JSON path to a JSON string and returns the resulting node
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Tue Aug 26 11:35:12 2014 | http://epydoc.sourceforge.net |