mirror of https://github.com/CIRCL/PyCIRCLean
Move filecheck logging tests back into tests/
* Add tests/logging/ directory with sample filespull/21/head
parent
dee35a5331
commit
9ad04da755
|
@ -0,0 +1 @@
|
||||||
|
test
|
|
@ -0,0 +1 @@
|
||||||
|
test.txt
|
|
@ -0,0 +1 @@
|
||||||
|
test
|
|
@ -0,0 +1 @@
|
||||||
|
test
|
|
@ -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()
|
|
Loading…
Reference in New Issue