22 Commits

Author SHA1 Message Date
Christopher Allan Webber
cd4a7492cd Fixing one more bytes vs string battle in Python 3 2016-02-11 11:36:05 -08:00
Berker Peksag
03d4be0e39 Fix an usage of file(). 2014-06-08 08:19:04 +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
958080be16 All mediagoblin tests now pass with py.test (switched setUp to setup) 2013-04-03 14:05:42 -05:00
Elrond
626a093ccc Move workbench into tools directory. 2013-01-17 22:15:57 +01:00
Sebastian Spaeth
9408938bcc Add @get_workbench test
Test the decorator function and proper cleanup after it's usage.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2013-01-16 20:19:26 +01:00
Sebastian Spaeth
bd6fe97746 Shorten Workbench(Manager) method names
1) destroy_self() is a horrible function name, make it "destroy".
workbench.destroy() is descriptive enough.

2) WorkbenchManager.create_workbench() -> WorkbenchManager.create()
  We use the pattern "with workbench_manager.create() as workbench:"
  No need to mention workbenches three times in a row...

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2013-01-16 20:19:25 +01:00
Will Kahn-Greene
a855e92a98 Fix problems from pyflakes output 2012-06-03 15:53:34 -04:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Will Kahn-Greene
12a100e4d8 508. Updates copyright/license information 2011-09-01 20:50:19 -04:00
Elrond
b67a983a02 Move destroy_workbench to Workbench class
And add a lot of warnings, as the checks for "being part of
the main Manager" are all gone.
2011-06-14 20:39:14 +02:00
Elrond
8bfa533f8b Drop WorkbenchManager.localized_file()
As Workbench has the localized_file() method, use this
everywhere and drop the wrapper method from
WorkbenchManager.

The processing code already did that.
2011-06-14 20:01:39 +02:00
Elrond
52426ae01f Create a Workbench class and use it everywhere.
Some references to Workbench.dir look ugly, I'm happy to
hear suggestions there.
2011-06-13 00:39:41 +02:00
Christopher Allan Webber
68ffb13690 possibly_localize_file->localized_file... a bit less terribly long. 2011-06-11 21:23:32 -05:00
Christopher Allan Webber
fdc5003903 Don't bother returning whether or not we copied it or not, we can
figure that out by looking to see whether our storage is local or not.
2011-06-11 21:20:26 -05:00
Christopher Allan Webber
a32acafa0b Moving workbench out of process_media 2011-06-11 20:33:41 -05:00
Christopher Allan Webber
f43ecb0fc4 test WorkbenchManager.possibly_localize_file() 2011-06-11 19:18:51 -05:00
Christopher Allan Webber
2ecee34f08 Make sure workbench won't kill directories out of scope. 2011-06-11 18:52:48 -05:00
Christopher Allan Webber
2616d70903 Tests for creating/destroying workbenches 2011-06-11 18:49:04 -05:00