mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Updated assert message for comparing results
This commit is contained in:
parent
edac05b850
commit
77d017bae2
1 changed files with 9 additions and 9 deletions
|
|
@ -24,16 +24,18 @@ class DBAssert:
|
||||||
else:
|
else:
|
||||||
args[key] = val
|
args[key] = val
|
||||||
|
|
||||||
msg = None
|
|
||||||
no_of_docs = dbcon.count_documents(args)
|
|
||||||
if expected != no_of_docs:
|
|
||||||
msg = "Not expected no of versions. "\
|
|
||||||
"Expected {}, found {}".format(expected, no_of_docs)
|
|
||||||
|
|
||||||
args.pop("type")
|
args.pop("type")
|
||||||
detail_str = " "
|
detail_str = " "
|
||||||
if args:
|
if args:
|
||||||
detail_str = " with {}".format(args)
|
detail_str = " with '{}'".format(args)
|
||||||
|
|
||||||
|
msg = None
|
||||||
|
no_of_docs = dbcon.count_documents(args)
|
||||||
|
if expected != no_of_docs:
|
||||||
|
msg = "Not expected no of '{}'{}."\
|
||||||
|
"Expected {}, found {}".format(queried_type,
|
||||||
|
detail_str,
|
||||||
|
expected, no_of_docs)
|
||||||
|
|
||||||
status = "successful"
|
status = "successful"
|
||||||
if msg:
|
if msg:
|
||||||
|
|
@ -42,7 +44,5 @@ class DBAssert:
|
||||||
print("Comparing count of {}{} {}".format(queried_type,
|
print("Comparing count of {}{} {}".format(queried_type,
|
||||||
detail_str,
|
detail_str,
|
||||||
status))
|
status))
|
||||||
if msg:
|
|
||||||
print(msg)
|
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue