refactored few condition to fix failing test cases
@@ -352,13 +352,19 @@ def loadPlugin(cli, pluginPkgName):
def assertCliTokens(matchedVars, tokens):
- for key, value in tokens.items():
+ for key, expectedValue in tokens.items():
matchedValue = matchedVars.get(key)
- assert matchedValue is not None, "Key '{}' not found in machedVars " \
- "(matchedValue={})".format(key, matchedValue)
- assert matchedValue == value, "Value not matched for key '{}', " \
+
+ if expectedValue is not None:
+ assert matchedValue is not None, \
+ "Key '{}' not found in machedVars (matchedValue={})".\
+ format(key, matchedValue)
+
+ assert matchedValue == expectedValue, \
+ "Value not matched for key '{}', " \
"\nexpectedValue (length: {}): {}, " \
"\nactualValue (length: {}): {}".\
- format(key, len(value), value, len(matchedValue), matchedValue)
+ format(key, len(expectedValue), expectedValue,
+ len(matchedValue), matchedValue)
