Skip to content

Commit

Permalink
address @yocalebo
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorcary committed Sep 3, 2024
1 parent c51443b commit bc2328f
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tests/api2/test_pool_dataset_quota_alert.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# License: BSD

import re

import pytest
from pytest_dependency import depends
from functions import SSH_TEST
from auto_config import pool_name, user, password

from auto_config import pool_name, user, password
from functions import SSH_TEST
from middlewared.test.integration.utils import call


G = 1024 * 1024 * 1024


Expand Down Expand Up @@ -62,14 +62,10 @@ def test_dataset_quota_alert(request, datasets, expected_alerts):
f'bs=1M count={used}', user, password)
assert results['result'] is True, results

results = SSH_TEST("midclt call alert.initialize", user, password)
assert results['result'] is True, results

results = SSH_TEST("midclt call --job core.bulk alert.process_alerts '[[]]'", user, password)
assert results['result'] is True, results
call("alert.initialize")
call("core.bulk", "alert.process_alerts", [[]], job=True)

alerts = [alert for alert in call("alert.list") if alert["source"] == "Quota"]

assert len(alerts) == len(expected_alerts), alerts

for alert, expected_alert in zip(alerts, expected_alerts):
Expand Down

0 comments on commit bc2328f

Please sign in to comment.