Move filecheck logging tests back into tests/

* Add tests/logging/ directory with sample files
pull/21/head
Dan Puttick 2017-07-20 13:18:48 -04:00
parent dee35a5331
commit 9ad04da755
6 changed files with 9 additions and 12 deletions

0
tests/logging/.keepdir Normal file
View File

View File

@ -0,0 +1 @@
test

1
tests/logging/symlink_test Symbolic link
View File

@ -0,0 +1 @@
test.txt

1
tests/logging/test.conf Normal file
View File

@ -0,0 +1 @@
test

1
tests/logging/test.txt Normal file
View File

@ -0,0 +1 @@
test

View File

@ -2,14 +2,14 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import datetime from datetime import datetime
from bin.filecheck import KittenGroomerFileCheck from bin.filecheck import KittenGroomerFileCheck
def save_logs(groomer, test_description): def save_logs(groomer, test_description):
divider = ('=' * 10 + '{}' + '=' * 10 + '\n') divider = ('=' * 10 + '{}' + '=' * 10 + '\n')
test_log_path = 'tests/test_logs/{}.log'.format(test_description) test_log_path = 'tests/{}.log'.format(test_description)
time_now = str(datetime.now().time()) + '\n' time_now = str(datetime.now().time()) + '\n'
with open(test_log_path, 'wb+') as test_log: with open(test_log_path, 'wb+') as test_log:
log_header = divider.format('TEST LOG') log_header = divider.format('TEST LOG')
@ -33,14 +33,7 @@ def save_logs(groomer, test_description):
test_log.write(out) test_log.write(out)
def main(): def test_logging(tmpdir):
groomer = KittenGroomerFileCheck() groomer = KittenGroomerFileCheck('tests/logging/', tmpdir.strpath)
groomer.run() groomer.run()
save_logs(groomer, "Groomer") save_logs(groomer, "visual_logging_test")
# initialize groomer
# run groomer
# save logs
if __name__ == '__main__':
main()