mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix fail2ban tests
This commit is contained in:
parent
8c27bf8c7c
commit
578bfe9798
@ -1,4 +1,5 @@
|
|||||||
"""The tests for local file sensor platform."""
|
"""The tests for local file sensor platform."""
|
||||||
|
from datetime import timedelta
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import Mock, patch
|
||||||
|
|
||||||
@ -118,7 +119,7 @@ class TestBanSensor(unittest.TestCase):
|
|||||||
|
|
||||||
def test_ipv6_ban(self):
|
def test_ipv6_ban(self):
|
||||||
"""Test that log is parsed correctly for IPV6 bans."""
|
"""Test that log is parsed correctly for IPV6 bans."""
|
||||||
log_parser = BanLogParser(timedelta(seconds=-1), '/tmp')
|
log_parser = BanLogParser('/tmp')
|
||||||
sensor = BanSensor('fail2ban', 'jail_one', log_parser)
|
sensor = BanSensor('fail2ban', 'jail_one', log_parser)
|
||||||
assert sensor.name == 'fail2ban jail_one'
|
assert sensor.name == 'fail2ban jail_one'
|
||||||
mock_fh = MockOpen(read_data=fake_log('ipv6_ban'))
|
mock_fh = MockOpen(read_data=fake_log('ipv6_ban'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user