mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +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:
|
||||
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")
|
||||
detail_str = " "
|
||||
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"
|
||||
if msg:
|
||||
|
|
@ -42,7 +44,5 @@ class DBAssert:
|
|||
print("Comparing count of {}{} {}".format(queried_type,
|
||||
detail_str,
|
||||
status))
|
||||
if msg:
|
||||
print(msg)
|
||||
|
||||
return msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue