diff --git a/tests/logging/.keepdir b/tests/logging/.keepdir new file mode 100644 index 0000000..e69de29 diff --git a/tests/logging/dir1/dir2/test.txt b/tests/logging/dir1/dir2/test.txt new file mode 100644 index 0000000..30d74d2 --- /dev/null +++ b/tests/logging/dir1/dir2/test.txt @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/tests/logging/symlink_test b/tests/logging/symlink_test new file mode 120000 index 0000000..541cb64 --- /dev/null +++ b/tests/logging/symlink_test @@ -0,0 +1 @@ +test.txt \ No newline at end of file diff --git a/tests/logging/test.conf b/tests/logging/test.conf new file mode 100644 index 0000000..30d74d2 --- /dev/null +++ b/tests/logging/test.conf @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/tests/logging/test.txt b/tests/logging/test.txt new file mode 100644 index 0000000..30d74d2 --- /dev/null +++ b/tests/logging/test.txt @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/tests/filecheck_logging.py b/tests/test_filecheck_logging.py similarity index 82% rename from tests/filecheck_logging.py rename to tests/test_filecheck_logging.py index 67eb44c..012e733 100644 --- a/tests/filecheck_logging.py +++ b/tests/test_filecheck_logging.py @@ -2,14 +2,14 @@ # -*- coding: utf-8 -*- import os -import datetime +from datetime import datetime from bin.filecheck import KittenGroomerFileCheck def save_logs(groomer, test_description): 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' with open(test_log_path, 'wb+') as test_log: log_header = divider.format('TEST LOG') @@ -33,14 +33,7 @@ def save_logs(groomer, test_description): test_log.write(out) -def main(): - groomer = KittenGroomerFileCheck() +def test_logging(tmpdir): + groomer = KittenGroomerFileCheck('tests/logging/', tmpdir.strpath) groomer.run() - save_logs(groomer, "Groomer") - # initialize groomer - # run groomer - # save logs - - -if __name__ == '__main__': - main() + save_logs(groomer, "visual_logging_test")