28 Commits

Author SHA1 Message Date
Berker Peksag
ef3badb3b4 Use new-style classes. The old-style classes are deprecated in Python 3. 2014-06-08 08:20:17 +03:00
Berker Peksag
d9aced73f1 The file() builtin has been removed in Python 3. Use open() instead. 2014-06-07 13:51:42 +03:00
Berker Peksag
e49b7e02b2 Use six.text_type instead of unicode().
I will be switch to use ``from __future__ import unicode_literals`` later.
2014-06-02 20:59:28 +03:00
Christopher Allan Webber
9a9bafc078 Reverting "Always activate testing in every test module ever."
Revert "Always activate testing in every test module ever."

This reverts commit 0536306048daa0970d2e43411ba2a9bf073e570e.
2013-05-17 11:12:56 -05:00
Christopher Allan Webber
0536306048 Always activate testing in every test module ever.
Kind of a dorky way to implement this, but...
2013-05-16 17:51:21 -05:00
Elrond
fd1202b774 Cleanup storage after test, and test .delete_dir().
The storage tests work in the system's tmpdir. The python
docs say, we should clean up after using things.  Yes the
directory should be cleaned up on reboot, but if running
tests a lot, the tmpdir could fill up, so we should really
cleanup.

So use the new .delete_dir() on the storage interface to
cleanup test dirs and get them finally removed with
os.rmdir. All nicely packed into cleanup_storage().
2013-04-21 19:26:57 +02:00
Elrond
25067d8110 Testing: Remove some left over files/dirs.
When using tempfile.* in testing, those files get created
in the system tempdir. The docs say, we should try to
remove them.
Yes, the next reboot will clean them up also.

And in the workbench case, check after each test, that the
global workbench dir is empty (so the sub-workbcnhes have
been destroyed).
2013-04-08 17:03:26 +02:00
Christopher Allan Webber
7d503a897b Really removing nosetests things now! all assert_whatever removed 2013-04-06 10:08:26 -05:00
Sebastian Spaeth
7e55bcb898 Fix up tests
empty find() queries would not work anymore with the simplified .find
compatability code, so remove these and use proper sqlalchemy in the
tests.

The storage test failed because my virtualenv environment ran
mediagoblin/local/mediagoblin/tests/test_storage.py and somehow decided
the 2 classes are different objects. Just test against the full class name.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2012-12-21 00:30:48 +01:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Christopher Allan Webber
e56e5f8c5c Tests for StorageInterface*.copy_local_to_storage() 2011-11-20 22:25:22 -06:00
Joar Wandborg
a2468d18ca Feature #587 - Split storage.py into submodules
*   Removed storage.py
*   Created submodules for filestorage, cloudfiles, mountstorage
*   Changed test_storage to reflect the changes made in the storage
    module structure
*   Added mediagoblin.storage.filestorage.BasicFileStorage as a
    default for both publicstore and queuestore's `storage_class`
2011-09-12 02:32:03 +02:00
Will Kahn-Greene
12a100e4d8 508. Updates copyright/license information 2011-09-01 20:50:19 -04:00
Christopher Allan Webber
63c9a0c766 Updating tests for new storage config code 2011-08-21 15:14:45 -05:00
Christopher Allan Webber
3c7d11ff28 renaming storage_system_from_paste_config()->storage_system_from_config()
As Elrond points out, this name doesn't make sense anymore since this
isn't based on the paste config.  Thanks Elrond!
2011-06-19 11:36:52 -05:00
Christopher Allan Webber
d91b5a7c2d Added a FakeRemoteStorage, for testing purposes 2011-06-11 19:17:44 -05:00
Christopher Allan Webber
6a07362dd0 Adding a copy_locally() method to the StorageInterface and giving it a test. 2011-06-11 12:04:30 -05:00
Christopher Allan Webber
3a89c23e7f Allow storage systems to be local and allow for a get_local_path
method if applicable.
2011-06-11 11:18:03 -05:00
Christopher Allan Webber
ffa2293549 storage.storage_system_from_paste_config() utility, w/ tests 2011-04-17 10:24:36 -05:00
Christopher Allan Webber
01da9e6a0e Test for BasicFileStorage.file_url() 2011-04-16 12:47:15 -05:00
Christopher Allan Webber
d024806a0b Tests for BasicFileStorage.delete_file() 2011-04-16 11:03:32 -05:00
Christopher Allan Webber
d2be0838a7 Tests for BasicFileStorage.get_file() 2011-04-16 11:00:53 -05:00
Will Kahn-Greene
8e1e744d27 Changes Mediagoblin -> MediaGoblin. 2011-04-13 10:04:30 -04:00
Christopher Allan Webber
20e3ee115d Test BasicFileStorage.get_unique_filepath() 2011-04-10 16:51:25 -05:00
Christopher Allan Webber
92fb87ae8d Unit tests for BasicFileStorage.file_exists() 2011-04-10 16:23:55 -05:00
Christopher Allan Webber
17e7093e4b Started BasicFileStorage tests. test_basic_storage__resolve_filepath() done.
Also switched to using assert_raises, which is only sane!
2011-04-10 15:50:32 -05:00
Christopher Allan Webber
770c12be8d Raise a specific error if a filename component can't be resolved into anything. 2011-04-09 11:45:38 -05:00
Christopher Allan Webber
a6b378ef4d file storage filelist cleaning 2011-04-09 11:41:09 -05:00