mirror of
https://github.com/home-assistant/core.git
synced 2025-08-09 23:55:07 +02:00
Fix fail2ban tests
This commit is contained in:
@@ -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'))
|
||||||
|
Reference in New Issue
Block a user