Commit Graph

286 Commits (60bd5362c119e9ce0db36b9f955e1f4dac0284d1)

Author SHA1 Message Date
Dan Puttick 60bd5362c1 Add normal word doc to file_catalog 2017-07-27 17:06:15 -04:00
Dan Puttick 00ac5da5f7 Move Example.svg from normal to dangerous 2017-07-24 16:29:34 -04:00
Dan Puttick f71eecbae1 Re-add the zoo to Travis build 2017-07-20 18:40:16 -04:00
Dan Puttick 159bc9cee2 Add __repr__s to File and KittenGroomerFileCheck 2017-07-20 18:40:16 -04:00
Dan Puttick 92d77e1a82 Revert change to magic.from_file 2017-07-20 18:40:16 -04:00
Dan Puttick c3fed019ab Fix travis build 2017-07-20 18:40:16 -04:00
Dan Puttick 4bc113cefa Open file and magic.read_buffer in helpers.py 2017-07-20 18:40:16 -04:00
Dan Puttick cc5d1e5117 Fix issue with hashing symlinks to directories 2017-07-20 18:40:16 -04:00
Dan Puttick 3eff10fbcd Unicode error check travis 2017-07-20 18:40:16 -04:00
Dan Puttick 4205d57dec Fix logging for errors and symlinks 2017-07-20 18:40:16 -04:00
Dan Puttick 9ad04da755 Move filecheck logging tests back into tests/
* Add tests/logging/ directory with sample files
2017-07-20 18:40:16 -04:00
Dan Puttick dee35a5331 Fix description string behavior
* Make description string property return a string instead of array
2017-07-20 18:40:16 -04:00
Dan Puttick fe82a5ac0d Change rest of lists in Config to tuples 2017-07-20 18:40:16 -04:00
Dan Puttick 5527cbeeb7 Add main() to logging test file 2017-07-20 18:40:16 -04:00
Raphaël Vinot 338bd5a018 Merge pull request #16 from dputtick/dev
Bug fixes, test file catalog, refactoring
2017-07-18 14:03:22 +02:00
Dan Puttick 35eb8ea8ab Fixups for PR #16
* ObjectPool winoffice files are now make_dangerous
* safe_copy now catches IOErrors only
* Use os.makedirs(exist_ok=True) instead of checking for existence in safe_copy
and create_metadata_file
* Added stubs for two tests related to safe_copy
2017-07-17 14:52:22 -04:00
Dan Puttick 0c35885f17 Prevent copying MacOS hidden files 2017-07-17 10:22:46 -04:00
Dan Puttick 5aaeac6f16 Refactor FileBase.extension 2017-07-17 10:10:21 -04:00
Dan Puttick fcbf2e6574 Add tests for force_ext and groomer 2017-07-17 09:17:20 -04:00
Dan Puttick 814f7b84a1 Temporarily disable 42.zip in travis build 2017-07-16 20:18:05 -04:00
Dan Puttick 9761d44eda Temporarily remove 42.zip from dangerous/
* When running the tests locally, difficult to unzip 42.zip. Also, there's
no need for such a complicated archivebomb example. We can prove the same
effectiveness against archivebombs with a file like archivebomb.zip
2017-07-16 18:42:23 -04:00
Dan Puttick 770b1da922 Add archivebomb.zip to tests/dangerous 2017-07-16 18:38:07 -04:00
Dan Puttick 270597586e Remove self.cur_file from filecheck 2017-07-16 18:36:22 -04:00
Dan Puttick a47a00d7a9 Fix bug in split_mimetype and add test 2017-07-16 14:25:16 -04:00
Dan Puttick 36c4493cd6 Fix handling of symlinks 2017-07-16 14:05:48 -04:00
Dan Puttick fabc2cf7c4 Move Travis-only test files to uncategorized 2017-07-14 22:03:56 -04:00
Dan Puttick 7363a16318 Remove calls to make_binary and make_unknown 2017-07-14 21:57:29 -04:00
Dan Puttick 41abe7e5d6 Prevent following arbitrarily nested symlinks 2017-07-14 17:52:21 -04:00
Dan Puttick d7280a8535 Add tests for make_dangerous and safe_copy 2017-07-14 17:37:30 -04:00
Dan Puttick b77451ae7a Description_string now only allows strings 2017-07-14 16:42:31 -04:00
Dan Puttick a2989cfbd3 Add tests for mimetypes 2017-07-14 16:40:26 -04:00
Dan Puttick 930b059ae1 Add tests for has_extension 2017-07-14 14:06:55 -04:00
Dan Puttick df97228a75 Fix symlink behavior in helpers.py 2017-07-13 17:36:43 -04:00
Dan Puttick 6a96d3f7a2 Add tests for helpers.py 2017-07-13 17:01:02 -04:00
Dan Puttick 14b9d71da8 Mock out GroomerLogger in test_filecheck 2017-07-13 17:00:41 -04:00
Dan Puttick d3576db35d Stub out new unit tests 2017-07-13 14:44:51 -04:00
Dan Puttick 27cbdc57bc Fix FileBase.make_dangerous filename editing
* make_dangerous should only modify the filename if the file
wasn't previously identified as dangerous
* add_description should only be called if a reason_string
is supplied
2017-07-13 12:55:26 -04:00
Dan Puttick e19064c83f Refactor FileBase to store props as attributes
* This is kind of a big refactoring - I realized that storing file
props in a dict was causing some subtle problems, and that just having
them as attributes makes things a lot more simple
* I considered making a separate FileProps object and nesting it
inside FileBase, but almost all FileBase methods concern manipulating
file props, so it didn't really make sense.
* Tests are almost passing with this commit, but need a few more changes
and fixes for full test coverage + all passing.
2017-07-12 17:58:39 -04:00
Dan Puttick f424be79cd Move KittenGroomerError to end of file 2017-07-11 15:48:40 -04:00
Dan Puttick 7b8b175a93 Fixup comments, add stubs for new tests 2017-07-11 15:48:40 -04:00
Dan Puttick 966c577ff8 Add uncategorized 2017-07-11 15:47:48 -04:00
Dan Puttick fed4f75cd7 Filecheck tests work with file catalog 2017-07-07 16:09:06 -04:00
Dan Puttick e977966480 Reorganize filecheck tests
* Move all SampleFile code into test_filecheck.py
* Make a stub for logging tests in test_filecheck_logging.py
2017-07-07 16:02:20 -04:00
Dan Puttick 0bec2a8345 Add PyYAML to dev-requirements.txt 2017-07-06 18:00:04 -04:00
Dan Puttick 871eea7a68 Working version of file-by-file testing 2017-07-06 15:41:38 -04:00
Dan Puttick 3f9be48cbd Initial version of individual file test harness
* Parametrized test for normal and dangerous files
* Still needs a way to handle "complex" files (ones that require a full groomer
due to having temporary folders), as well as a way to read .expect test description
files
2017-07-05 18:09:10 -04:00
Dan Puttick e88ec8a474 Rename src_valid and src_invalid
* In preparation for having source files be a submodule instead of bundled with PyCIRCLean
* First, going to get the tests running with the new set of files
* Then, going to make the tests run file by file instead of on the whole directory
* Also, need to rewrite the KittenGroomer tests to mock the libmagic methods
2017-06-30 15:25:53 -04:00
Dan Puttick a73b746f5a Removing unneeded test files 2017-06-28 16:01:42 -04:00
Dan Puttick 7ead07814a Delete testfile_catalog
* Test files are being moved to separate repo
2017-06-27 14:36:58 -04:00
Dan Puttick 141a64cf33 Remove extra comments from helpers.py
* Was thinking about removing processdir and main, but somebody might still
want to use them + they could be a helpful reference for a new person.
2017-06-27 12:13:29 -04:00