summaryrefslogtreecommitdiffstats
path: root/tests/file_test.py
Commit message (Collapse)AuthorAgeFilesLines
* Copyright changed.Siddharth Ravikumar2016-03-011-1/+1
| | | | From combox contributors -> Dr. Robert C. Green II.
* authors -> contributors.Siddharth Ravikumar2015-12-221-1/+1
|
* .py files coding set to utf-8.Siddharth Ravikumar2015-12-221-0/+2
|
* added new function file.no_of_shards + tests.Siddharth Ravikumar2015-08-251-0/+30
| | | | | modified: combox/file.py modified: tests/file_test.py
* updated combox.file.relative_path.Siddharth Ravikumar2015-04-011-2/+10
| | | | | | | | | This method now returns relative paths w. r. t all node directories. Before it used to return relative paths only w. r. t the first node directory. Also updated the tests for it :~( modified: combox/file.py modified: tests/file_test.py
* new function combox.file.node_paths: returns the abs. path of ↵Siddharth Ravikumar2015-03-191-0/+29
| | | | | | | shards/directories in node directories. modified: combox/file.py modified: tests/file_test.py
* In tests, the code that purges the files/directories in `purge_list' is now ↵Siddharth Ravikumar2015-03-191-8/+6
| | | | | | | | a function. modified: tests/events_test.py modified: tests/file_test.py modified: tests/utils.py
* modded combox.file.node_path function.Siddharth Ravikumar2015-03-061-2/+4
| | | | | | | | | | | It has a third argument (boolean) which tells whether `cb_path' (the first argument) is a file or not. Updated the test for node_path function + code wherever node_path was used. modified: combox/events.py modified: combox/file.py modified: tests/file_test.py
* renamed combox.file.rm_dir -> combox.file.rm_pathSiddharth Ravikumar2015-03-041-3/+11
| | | | | | | | rm_path deletes a file or an empty directory. updated the test for it too. modified: tests/file_test.py
* new function combox.file.mk_dirSiddharth Ravikumar2015-03-041-0/+22
| | | | | | | wrote test for it too. modified: combox/file.py modified: tests/file_test.py
* new function combox.file.rm_dirSiddharth Ravikumar2015-03-041-0/+10
| | | | | | | also wrote test for it. modified: combox/file.py modified: tests/file_test.py
* modded combox.file.hash_file function -- added new arg `file_content'Siddharth Ravikumar2015-02-261-2/+4
| | | | | | | | | | - `file_content' is set to None by default - If `file_content' is not None, hash of this is returned. Updated the test for hash_file function. modified: combox/file.py modified: tests/file_test.py
* tests/file_test.py: corrected typo in the docstring of test_cbpath method.Siddharth Ravikumar2015-02-251-1/+1
|
* new function combox.file.node_path.Siddharth Ravikumar2015-02-251-0/+19
| | | | | | | | | | | | | This function takes the path to the file in the combox and returns the path of its first shard in the node directory. If the the given argument is a directory (inside the combox directory), the function returns the corresponding path of the directory under the first node directory. Test for the function was also written. modified: combox/file.py modified: tests/file_test.py
* Refactored combox.file.cb_path to accept a file or a directory under a node ↵Siddharth Ravikumar2015-02-201-1/+8
| | | | | | | | | | | directory. It returns the path of the respective file or directory in the combox directory. Also updated the test for this function at tests.file_test.TestFile.test_cbpath modified: combox/file.py modified: tests/file_test.py
* Defined new function in combox.file.cb_pathSiddharth Ravikumar2015-02-191-0/+10
| | | | | | | | | | This function, given the path of a file shard, returns the corresponding path of the file in the combox directory. The test for this function is at tests.file_test.TestFile.test_cbpath modified: combox/file.py modified: tests/file_test.py
* tests/file_test.py: in test_relativepath method path.join is used to ↵Siddharth Ravikumar2015-02-191-3/+2
| | | | construct pathnames.
* modded combox.file.relative_path function.Siddharth Ravikumar2015-02-191-3/+21
| | | | | | | | | | Now the function is rigged up to return path relative to both combox directory and node directory. Corresponding test for this function is at tests.file_test module. modified: combox/file.py modified: tests/file_test.py
* All the test classes now call rm_configdir() in their teardown method.Siddharth Ravikumar2015-02-181-1/+2
| | | | | | | | modified: tests/config_test.py modified: tests/crypto_test.py modified: tests/events_test.py modified: tests/file_test.py modified: tests/silo_test.py
* All the tests now remove the node directories (tests/shard-dir-0 & ↵Siddharth Ravikumar2015-02-131-1/+2
| | | | | | | | | | | | | tests/shard-dir-1) in the teardown method. modified: tests/config_test.py modified: tests/crypto_test.py modified: tests/events_test.py modified: tests/file_test.py modified: tests/silo_test.py deleted: tests/shard-dir-0/.foo deleted: tests/shard-dir-1/.foo
* tests/crypto_test.py & tests/file_test.py - corrected typos in doctstrings.Siddharth Ravikumar2015-02-131-1/+1
|
* tests/file_test.py: re-wrote it.Siddharth Ravikumar2015-02-111-48/+54
| | | | Now the test is in a Test class with proper setup and teardown methods.
* combox/file.py: defined hash_file function.Siddharth Ravikumar2015-01-211-1/+13
| | | | | | hash_file function returns the SHA512 hash of the file's content. The test for the hash_file function is at tests/file_test.py
* updated copright year.Siddharth Ravikumar2015-01-201-1/+1
| | | | | | | | | | | | modified: combox/cbox.py modified: combox/config.py modified: combox/crypto.py modified: combox/events.py modified: combox/file.py modified: tests/config_test.py modified: tests/crypto_test.py modified: tests/events_test.py modified: tests/file_test.py
* tests/file_test.py: uses get_nodedirs function to fetch list of node ↵Siddharth Ravikumar2015-01-131-1/+2
| | | | directories.
* rewrote the read_shards() and write_shards() function in combox/file.py.Siddharth Ravikumar2015-01-131-12/+23
| | | | | | | | | Tests were accordingly modded and now use the test config.yaml to split and write shards to dirs. modified: combox/file.py modified: tests/crypto_test.py modified: tests/file_test.py
* Added `nose' for combox/config.py, combox/crypto.py, combox/file.pySiddharth Ravikumar2015-01-121-0/+72
new file: tests/config_test.py new file: tests/crypto_test.py new file: tests/file_test.py