2017-12-16 18:59:33 +01:00
|
|
|
|
# pyruse is intended as a replacement to both fail2ban and epylog
|
2018-01-31 08:28:05 +01:00
|
|
|
|
# Copyright © 2017–2018 Y. Gablin
|
2017-12-16 18:59:33 +01:00
|
|
|
|
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
|
2017-12-15 19:36:50 +01:00
|
|
|
|
from pyruse.filters.filter_userExists import Filter
|
|
|
|
|
|
|
|
|
|
def whenUserExistsThenTrue():
|
|
|
|
|
assert Filter({"field": "user"}).filter({"user": "root"})
|
|
|
|
|
|
|
|
|
|
def whenGarbageThenFalse():
|
|
|
|
|
assert not Filter({"field": "user"}).filter({"user": "auietsnr"})
|
2018-01-31 08:28:05 +01:00
|
|
|
|
|
|
|
|
|
def unitTests():
|
|
|
|
|
whenUserExistsThenTrue()
|
|
|
|
|
whenGarbageThenFalse()
|