summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* After a file which was created a in a remote computer is reconstructed in ↵Siddharth Ravikumar2015-04-081-1/+6
| | | | | | | this computer, its info is removed from the 'file_created' dictionary in the silo. modified: combox/events.py modified: tests/events_test.py
* new method combox.silo.ComboxSilo.node_remSiddharth Ravikumar2015-04-081-0/+15
| | | | | | | | | | | The method removes information about a file in the category `type_' where `type_' can be 'file_created', 'file_modified', 'file_removed', 'file_moved'. Also wrote tests for it :~( modified: combox/silo.py modified: tests/silo_test.py
* added test file to purge list in tests.events_test.TestEvents.test_NDM_oncreatedSiddharth Ravikumar2015-04-081-0/+3
| | | | modified: tests/events_test.py
* Added test for directory creation in ↵Siddharth Ravikumar2015-04-081-15/+15
| | | | | | tests.events_test.TestEvents.test_NDM_oncreated. modified: tests/events_test.py
* renamed method test_NDM_oncreate -> test_NDM_oncreated in ↵Siddharth Ravikumar2015-04-081-2/+2
| | | | | | tests.event_test.TestEvents. modified: tests/events_test.py
* modded teardown method in tests.events_test.TestEvents.Siddharth Ravikumar2015-04-031-6/+2
| | | | | | the silo is purged using the deldb method instead of doing a os.remove. modfied: tests/events_test.py
* [golden commit]: rewrote combox.events.NodeDirMonitor.on_created method.Siddharth Ravikumar2015-04-011-8/+59
| | | | | | | | | | | | | | | | | | | | | - Now the the node monitor waits for all shards of the file, which was created on a remote computer, to arrive on this computer, before it re-constructs the file into the respective location in the combox directory. - Tests for it is at tests.events_test.TestEvents.test_NDM_oncreate method. - The main test method, tests.events_test.TestEvents.test_NDM, was disabled by renaming it to tests.events_test.TestEvents.test_NDM. - Now the NodeDirMonitor requires passing the 'node monitor lock' when creating an instance of it. :~( modified: combox/events.py modified: tests/events_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 variable at NodeDirMonitor -- `num_nodes'Siddharth Ravikumar2015-04-011-0/+9
| | | | | | | `num_nodes' a value that represents the number of node directories. modified: combox/events.py modified: tests/events_test.py
* renamed dict names in combox.silo.ComboxSilo from shard_* -> file_*Siddharth Ravikumar2015-04-011-51/+51
| | | | | | | | The main zarking reason for the name is that we might also want to track directories apart from shards in the node directories. modified: combox/silo.py modified: tests/silo_test.py
* refactored the way locks work in combox.siloComboxSilo.Siddharth Ravikumar2015-04-012-40/+44
| | | | | | | | modified: combox/cbox.py modified: combox/events.py modified: combox/silo.py modified: tests/events_test.py modified: tests/silo_test.py
* new methods in combox.silo.ComboxSilo -- node_get, node_set. noddicts.Siddharth Ravikumar2015-03-311-0/+110
| | | | | | | | These methods will be used to manage the dictionaries in the db related to the zarking shards. modified: combox/silo.py modified: tests/silo_test.py
* fleshed out combox.events.NodDirMonitor.housekeep method.Siddharth Ravikumar2015-03-261-2/+71
| | | | | | | wrote tests for it too :~( modified: combox/events.py modified: tests/events_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-193-15/+18
| | | | | | | | a function. modified: tests/events_test.py modified: tests/file_test.py modified: tests/utils.py
* fleshed out the on_move method in combox.events.NodeDirMonitorSiddharth Ravikumar2015-03-181-2/+61
| | | | | | | As usual, wrote correponding tests for it; zarking TDD or whatever :~| modified: combox/events.py modified: tests/events_test.py
* tests/events_test.py: paths in `purge_list' is purged after executing each ↵Siddharth Ravikumar2015-03-181-7/+8
| | | | test method.
* Added `shardp' method to combox.events.NodeDirMonitor + test for it.Siddharth Ravikumar2015-03-131-0/+10
| | | | | modified: combox/events.py modified: tests/events_test.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
* all the sleep calls are 1 sec long in tests.events_testSiddharth Ravikumar2015-03-041-5/+5
|
* fleshed out the on_delete method in combox.events.NodeDirMonitorSiddharth Ravikumar2015-03-041-2/+15
| | | | | | | As usual, wrote correponding tests for it :| modified: combox/events.py modified: tests/events_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
* fleshed out the NodeDirMonitor's on_modified method + wrote tests for it.Siddharth Ravikumar2015-02-261-0/+34
| | | | | modified: combox/events.py modified: tests/events_test.py
* updated tests.utils.shardedp - nows additionally checks if shard exists.Siddharth Ravikumar2015-02-261-1/+1
|
* 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
* updated combox.silo.ComboxSilo.stale method - added new arg fhashSiddharth Ravikumar2015-02-261-1/+2
| | | | | | | | - the arg `fhash' is set to None by default. - if `fhash' is not None, it is considered as file's current hash. modified: combox/silo.py modified: tests/silo_test.py
* updated tests.crypto_test.TestCrypto.test_convenience_cryptoSiddharth Ravikumar2015-02-261-1/+5
| | | | | Added code to test the new arg `write' in the decrypt_and_glue function.
* 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
* New combox.events.NodeDirMonitor class defined.Siddharth Ravikumar2015-02-201-6/+58
| | | | | | | | | | At the moment only the on_created method of this class is kinda fleshed out. The tests for this class is at tests.events_test.TestEvents.test_NDM modified: combox/events.py modified: tests/events_test.py
* modded tests/events_test.TestEvents.teardown methodSiddharth Ravikumar2015-02-201-1/+3
| | | | This method now checks if the `silo.db' exists before deleting it.
* 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
* combox/events.py: now the silo.db is purged after every test method in ↵Siddharth Ravikumar2015-02-191-7/+2
| | | | EventsTest class.
* tests/events_test.py: defined teardown method in TestEvents class.Siddharth Ravikumar2015-02-191-1/+7
| | | | | - The teardown method is invoked after the end of each test in the TestEvents class. - At the moment the teardown method just purges the node directories.
* tests/utils.py: modded `rm_nodedirs' and defined new function 'purge_nodedirs'Siddharth Ravikumar2015-02-191-2/+10
| | | | | - rm_nodedirs now calls purge_nodedirs and then deletes the node directories. - purge_nodedirs function just purges the contents of the node directories.
* 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-185-5/+11
| | | | | | | | 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
* tests/utils.py: added rm_configdir functionSiddharth Ravikumar2015-02-181-0/+10
| | | | | rm_configdir() will be used to remove the test-config/ directory and will be called in all teardown methods of Test classes.
* All the tests now remove the node directories (tests/shard-dir-0 & ↵Siddharth Ravikumar2015-02-137-5/+12
| | | | | | | | | | | | | 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/utils.py: added new function rm_nodedirs.Siddharth Ravikumar2015-02-131-1/+12
| | | | | rm_nodedirs purges the node directories. This function will be used later to remove the test node directories.
* tests/crypto_test.py & tests/file_test.py - corrected typos in doctstrings.Siddharth Ravikumar2015-02-132-2/+2
|
* tests/config_test.py: config.yaml file is purged after all the tests.Siddharth Ravikumar2015-02-131-5/+3
|
* removed tests/test-config/config.yaml - no longer needed.Siddharth Ravikumar2015-02-131-13/+0
|
* tests/silo_test.py: re-wrote it.Siddharth Ravikumar2015-02-131-45/+58
| | | | Now the test is in a Test class with proper setup and teardown methods.
* tests/events_test.py: now teardown purges the shards of TEST_FILESiddharth Ravikumar2015-02-131-0/+2
|
* tests/events_test.py: corrected typo in docstring.Siddharth Ravikumar2015-02-131-1/+1
|