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
|
mitigation_collection_name = AttackMitigations.COLLECTION_NAME
|
||||||
try:
|
try:
|
||||||
mongo.db.validate_collection(mitigation_collection_name)
|
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(
|
raise errors.OperationFailure(
|
||||||
"Mitigation collection empty. Try dropping the collection and running again"
|
"Mitigation collection empty. Try dropping the collection and running again"
|
||||||
)
|
)
|
||||||
|
|
|
@ -35,7 +35,7 @@ def fake_monkey():
|
||||||
return monkey.id
|
return monkey.id
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.usefixture("uses_database")
|
@pytest.mark.usefixtures("uses_database")
|
||||||
def test_get_credentials(fake_monkey):
|
def test_get_credentials(fake_monkey):
|
||||||
StolenCredentials(
|
StolenCredentials(
|
||||||
identities=fake_credentials["identities"],
|
identities=fake_credentials["identities"],
|
||||||
|
|
Loading…
Reference in New Issue