【RF库Collections测试】Dictionaries Should Be Equal

 

Name:
Dictionaries Should Be Equal
Source:
Collections
Arguments:
[ dict1 | dict2 | msg=None | values=True ]
Fails if the given dictionaries are not equal.
First the equality of dictionaries' keys is checked and after that all the key value pairs. If there are differences between the values, those are listed in the error message.
See `Lists Should Be Equal` for an explanation of `msg`. The given dictionaries are never altered by this keyword.

The error message can be configured using `msg` and `values` arguments:

If `msg` is not given, the default error message is used.

If `msg` is given and `values` is either Boolean False or a string 'False' or 'No Values', the error message is simply `msg`.

Otherwise the error message is `msg` + 'new line' + default.

首先判断字典所有的键是否相等,若相等,则判断所有键的值是否相同。

 

 场景1:

【RF库Collections测试】Dictionaries Should Be Equal_第1张图片

 场景2:

【RF库Collections测试】Dictionaries Should Be Equal_第2张图片

 

【RF库Collections测试】Dictionaries Should Be Equal_第3张图片

场景3:

【RF库Collections测试】Dictionaries Should Be Equal_第4张图片

【RF库Collections测试】Dictionaries Should Be Equal_第5张图片

 场景4:msg=${D2} not equal ${D4} ,values为空

 `msg` + 'new line' + default.

【RF库Collections测试】Dictionaries Should Be Equal_第6张图片

【RF库Collections测试】Dictionaries Should Be Equal_第7张图片

场景5:msg=${D2} not equal ${D4} ,values=False

【RF库Collections测试】Dictionaries Should Be Equal_第8张图片

【RF库Collections测试】Dictionaries Should Be Equal_第9张图片

场景6;msg=${D2} not equal ${D4} ,values=Boolean False

 

 

【RF库Collections测试】Dictionaries Should Be Equal_第10张图片

 场景7;msg=${D2} not equal ${D4} ,values=No Values

 

【RF库Collections测试】Dictionaries Should Be Equal_第11张图片

 

转载于:https://www.cnblogs.com/apple2016/p/7045789.html

你可能感兴趣的:(【RF库Collections测试】Dictionaries Should Be Equal)