forked from p15670423/monkey
Island, UT: Use count_documents instead of count
* count() is deprecated * pytest.mark.usefixtureS
This commit is contained in:
parent
943cb2fa7a
commit
8248004bce
|
@ -32,7 +32,7 @@ def _try_store_mitigations_on_mongo():
|
|||
mitigation_collection_name = AttackMitigations.COLLECTION_NAME
|
||||
try:
|
||||
mongo.db.validate_collection(mitigation_collection_name)
|
||||
if mongo.db.attack_mitigations.count() == 0:
|
||||
if mongo.db.attack_mitigations.count_documents({}) == 0:
|
||||
raise errors.OperationFailure(
|
||||
"Mitigation collection empty. Try dropping the collection and running again"
|
||||
)
|
||||
|
|
|
@ -35,7 +35,7 @@ def fake_monkey():
|
|||
return monkey.id
|
||||
|
||||
|
||||
@pytest.mark.usefixture("uses_database")
|
||||
@pytest.mark.usefixtures("uses_database")
|
||||
def test_get_credentials(fake_monkey):
|
||||
StolenCredentials(
|
||||
identities=fake_credentials["identities"],
|
||||
|
|
Loading…
Reference in New Issue