From 9ad04da75500ff6c14406760ba9b42eaf6090f26 Mon Sep 17 00:00:00 2001 From: Dan Puttick Date: Thu, 20 Jul 2017 13:18:48 -0400 Subject: [PATCH] Move filecheck logging tests back into tests/ * Add tests/logging/ directory with sample files --- tests/logging/.keepdir | 0 tests/logging/dir1/dir2/test.txt | 1 + tests/logging/symlink_test | 1 + tests/logging/test.conf | 1 + tests/logging/test.txt | 1 + ...eck_logging.py => test_filecheck_logging.py} | 17 +++++------------ 6 files changed, 9 insertions(+), 12 deletions(-) create mode 100644 tests/logging/.keepdir create mode 100644 tests/logging/dir1/dir2/test.txt create mode 120000 tests/logging/symlink_test create mode 100644 tests/logging/test.conf create mode 100644 tests/logging/test.txt rename tests/{filecheck_logging.py => test_filecheck_logging.py} (82%) 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")