Commit Graph

61 Commits (45d71cb362c3bd0bd5442e6dc482d22749c7aabc)

Author SHA1 Message Date
Dan Puttick 3e56787686 Update tests for new logger 2017-04-10 13:22:36 +02:00
Dan Puttick 67c90087ba Add time information to test logs 2017-04-10 13:22:36 +02:00
Dan Puttick 3f49612a23 Add new logger, move logging to filecheck
* Wrote a new text-based logger that displays all file information in the tree
instead of using two separate logs
* Stopped using twiggy since it wasn't giving us anything useful
* Moved a lot of the logging code to filecheck, since it didn't really seem
appropriate as an API. Left a Logging stub in kittengroomer to hold methods
that might be useful for implementing other loggers.
* For the new logger, had to change the way that we traverse the items in the
source file tree.
2017-04-10 13:22:20 +02:00
Dan Puttick c85ad27221 New test files 2017-04-10 12:54:07 +02:00
Dan Puttick 3e7b38c5d4 Improve doc strings on FileBase 2017-03-21 18:58:17 -04:00
Dan Puttick 6851461755 Change from two separate logs to one 2017-03-20 16:10:57 -04:00
Dan Puttick 51760ebbb1 Move default log setup back into filecheck
* Realized that the API consumer might want to write their own logging tool.
* FileBase and KittenGroomerBase will have no logging code.
* If the API consumer likes, they can import GroomerLogger and use it in their
implementation.
2017-03-20 16:10:57 -04:00
Dan Puttick 2a5decf0ad Add rtl sample file to src_invalid 2017-03-16 17:34:20 -04:00
Dan Puttick ac94cf5d6d Change the way test dst dirs are handled
* Each test folder now copies files into its own test directory
* Change gitignore due to dst dir changes
* Make sure logger.tree is called for every directory
2017-03-15 22:56:00 -04:00
Dan Puttick 963a2feef4 Change various methods to properties 2017-03-15 22:55:51 -04:00
Dan Puttick 0038d3ef66 Switch to using file properties
* make_dangerous now takes a description string
* add_file_string takes strings describing the file
2017-03-15 21:06:07 -04:00
Dan Puttick fc8923fddd Change Groomer private methods to public
* Changed safe_rmtree, safe_copy, safe_remove, and safe_mkdir to public methods
* If something is being used in a subclass it probably shouldn't be a private
method
2017-03-15 21:06:07 -04:00
Dan Puttick 12d5624b4d Change FileBase.log_details to Filebase._file_props
* _file_props is a dict that will hold all information about the file
* Updated filecheck.py to reflect this
* Potentially will change contents of file_props to being attributes on the
file in the future. This change would be easy since all access to _file_props
is now via set_property and get_property methods.
* Add filename to _file_props
2017-03-15 21:06:06 -04:00
Dan Puttick 1c58a7347e If no extentions FileBase.ext is now None 2017-03-15 21:06:06 -04:00
Dan Puttick 3d36c90d66 Make list_all_files a public method 2017-03-15 21:04:57 -04:00
Dan Puttick c6ecc5e3a3 Fix process_dir bug in filecheck tests 2017-03-15 21:04:57 -04:00
Dan Puttick 61aa14c98d Change _write_log to _print_log 2017-03-15 21:04:57 -04:00
Dan Puttick 9d2f5c7241 Add .jpg test file, testfile_directory.md
- Also fixed a bug with metadata code
2017-03-15 21:04:57 -04:00
Dan Puttick 7d62238270 Hacks to make tests pass before fixing 2017-03-15 21:04:57 -04:00
Dan Puttick 1cf8a62f46 First commit with Logger object
- Made logger object
- Moved some logger related code from Groomer to Logger
- Changed logging related tests
- Filecheck tests still do not pass
2017-03-15 21:04:57 -04:00
Dan Puttick 92d1b1cd93 Refactor metadata processing code 2017-03-15 21:01:28 -04:00
Dan Puttick 833ade6008 Change to Python 3 compatible only 2017-01-19 17:06:34 -05:00
Dan Puttick 3b1df108d5 Rename test_helpers 2017-01-19 16:19:15 -05:00
Dan Puttick faf534c66f Add test.obj to src_invalid 2017-01-19 16:12:32 -05:00
Dan Puttick 21cc175867 Move non-filecheck.py binaries into examples directory
Tests for these scripts also removed from /tests and from .travis.yml
Two .zip archives accidentally deleted from /tests/src_invalid, re-added them
and changed .gitignore to prevent the problem
2017-01-19 15:25:08 -05:00
Dan Puttick d4bfe794be In FileBase, self.extension is now always lowercase 2017-01-18 15:51:54 -05:00
Dan Puttick 43c01e0f05 Add example autorun.inf file to tests/src_invalid 2017-01-18 15:51:54 -05:00
Dan Puttick 3dad4faa61 Reorganize tests making them easier to run
- The tests now automatically run depending on whether you have the dependencies
installed, instead of failing and throwing exceptions.
- CONTRIBUTING.md has more information on how to run the tests.
- When the tests run, they will save their logs to /test_logs instead
of printing them so you can read them later.
- Change names of source file directories to make them more descriptive
2017-01-18 15:51:54 -05:00
Dan Puttick 35501b69af Create test_filecheck.py 2017-01-18 15:51:47 -05:00
Dan Puttick cef4223c53 Deleting old tests, minor test reorganization. 2016-12-16 17:36:21 -05:00
Dan Puttick cb4ae5deec Changing travis and tests to run filecheck in Python 3 2016-12-16 16:07:43 -05:00
Dan Puttick 0364e038e1 Added unit tests for KittenGroomerBase 2016-12-14 15:44:59 -05:00
Dan Puttick 196a9fcac1 Added unit tests for FileBase 2016-12-12 17:03:44 -05:00
Dan Puttick 52f56581d1 Skeleton of unit tests using pytest 2016-12-12 17:03:44 -05:00
Dan Puttick dc9c864e23 Removed __init__ from . and changed imports in tests
Python import system can be tricky, but I think that not having __init__ in
the main directory here is better. We'll have to make sure it doesn't break
anything.
2016-12-07 13:19:45 -05:00
Dan Puttick 67e825046d Added fixtures for source and dest in test_examples 2016-12-07 13:19:26 -05:00
Dan Puttick 516b14ca10 Renamed test src directories for clarity 2016-12-07 13:19:26 -05:00
Dan Puttick fdf8fae065 Created test_examples.py
Decided that it makes sense to test example code seperately from module code.
At some point might move these tests in with the example code, but for now am
keeping them seperate and simple.
2016-12-07 13:18:28 -05:00
Dan Puttick b450abbaaa Setting up pytest 2016-12-07 13:17:16 -05:00
Raphaël Vinot c4af907345 Add model/* example 2016-05-17 11:44:01 +02:00
Raphaël Vinot b9e38bfa3f Add message/* mimetype file 2016-05-17 11:15:38 +02:00
Raphaël Vinot 6154c3748d Add valid symlink 2016-05-17 11:11:24 +02:00
Raphaël Vinot a4b045030c Add testfile for symlinks 2016-05-16 20:24:25 +02:00
Raphaël Vinot 580385d0d9 Add zipbomb in the test script 2016-05-16 11:25:01 +02:00
Raphaël Vinot abb565094c Fix py3 support 2016-05-10 17:16:04 +02:00
Raphaël Vinot aaad11b5c1 Test plenty of doc & docx files 2016-02-01 11:45:50 +01:00
Raphaël Vinot df80af000c Run generic script on more docs 2016-02-01 11:26:33 +01:00
Raphaël Vinot 2dd0520964 Fix tests for python2.7 2016-01-29 10:51:43 +01:00
Raphaël Vinot 315e9590b8 Use smaller test suite on the converting script 2015-11-05 17:37:01 +01:00
Raphaël Vinot 531ab43dae Improve debug, add list of malicious ext 2015-11-05 00:10:30 +01:00