format code
This commit is contained in:
parent
1560093127
commit
a8bdc80612
2 changed files with 7 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
from typing import List, Optional
|
from typing import List
|
||||||
|
|
||||||
from diskcache import Cache
|
from diskcache import Cache
|
||||||
from nio import AsyncClient, MatrixRoom
|
from nio import AsyncClient, MatrixRoom
|
||||||
|
@ -86,9 +86,7 @@ class Command:
|
||||||
f"Receiving a command to create a silence for a duration of {duration}"
|
f"Receiving a command to create a silence for a duration of {duration}"
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(f"Read alert fingerprints for event {self.event_id} from cache")
|
||||||
f"Read alert fingerprints for event {self.event_id} from cache"
|
|
||||||
)
|
|
||||||
|
|
||||||
count_created_silences = 0
|
count_created_silences = 0
|
||||||
alert_fingerprints = self.cache[self.event_id]
|
alert_fingerprints = self.cache[self.event_id]
|
||||||
|
@ -127,9 +125,7 @@ class Command:
|
||||||
matchers.append(matcher)
|
matchers.append(matcher)
|
||||||
|
|
||||||
logger.debug("Receiving a command to delete a silence")
|
logger.debug("Receiving a command to delete a silence")
|
||||||
logger.debug(
|
logger.debug(f"Read alert fingerprints for event {self.event_id} from cache")
|
||||||
f"Read alert fingerprints for event {self.event_id} from cache"
|
|
||||||
)
|
|
||||||
|
|
||||||
count_removed_silences = 0
|
count_removed_silences = 0
|
||||||
alert_fingerprints = self.cache[self.event_id]
|
alert_fingerprints = self.cache[self.event_id]
|
||||||
|
|
|
@ -74,7 +74,7 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase):
|
||||||
"ack",
|
"ack",
|
||||||
self.fake_room,
|
self.fake_room,
|
||||||
self.fake_sender,
|
self.fake_sender,
|
||||||
self.fake_event_id
|
self.fake_event_id,
|
||||||
)
|
)
|
||||||
await command.process()
|
await command.process()
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase):
|
||||||
command_word,
|
command_word,
|
||||||
self.fake_room,
|
self.fake_room,
|
||||||
self.fake_sender,
|
self.fake_sender,
|
||||||
self.fake_event_id
|
self.fake_event_id,
|
||||||
)
|
)
|
||||||
await command.process()
|
await command.process()
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase):
|
||||||
"help",
|
"help",
|
||||||
self.fake_room,
|
self.fake_room,
|
||||||
self.fake_sender,
|
self.fake_sender,
|
||||||
self.fake_event_id
|
self.fake_event_id,
|
||||||
)
|
)
|
||||||
await command.process()
|
await command.process()
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ class CommandTestCase(unittest.IsolatedAsyncioTestCase):
|
||||||
"",
|
"",
|
||||||
self.fake_room,
|
self.fake_room,
|
||||||
self.fake_sender,
|
self.fake_sender,
|
||||||
self.fake_event_id
|
self.fake_event_id,
|
||||||
)
|
)
|
||||||
await command.process()
|
await command.process()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue