jw-devtest/test/list-cmd/test.py
Jan Lindemann 03da0449c4 Add test/list-cmd
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 11:12:26 +01:00

24 lines
651 B
Python

#!/usr/bin/python3.8
from jwutils.misc import multi_regex_edit
from jwutils.log import *
from devtest.os.test import ListCmd as Base
class TestCase(Base):
def _filter(self, output):
slog(WARNING, "Running filter")
output = multi_regex_edit([
('del', 'nonexist'),
('sub', '/usr/bin', '/klaut/bin')
], output)
return output
if __name__ == '__main__':
set_level(INFO)
refpath = 'ps-ref.txt'
testpath = 'ps-out.txt'
with open(testpath, "r") as f:
lines = f.readlines()
features = set(['polp'])
TestCase(refpath, write_response=True).test(lines, features)