mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-devtest
synced 2026-01-15 10:23:32 +01:00
Add test/list-cmd
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
4b912741cb
commit
03da0449c4
4 changed files with 165 additions and 0 deletions
24
test/list-cmd/test.py
Normal file
24
test/list-cmd/test.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue