249 Commits

Author SHA1 Message Date
Joar Wandborg
e2890c729f Fixed pylint issues, removed unused import 2012-10-02 22:29:22 +02:00
Joar Wandborg
111a609df5 Replaced all request.POST with request.form, ...
- Fixed error handling in OAuth plugin
- Changed request.POST file fields to request.files
2012-09-29 21:08:20 +02:00
Joar Wandborg
a6ec38c3c1 Added OAuth test 2012-09-29 21:08:20 +02:00
Joar Wandborg
bee079f36f Fixed pylint/pep8 warnings in test/tools.py 2012-09-29 21:08:20 +02:00
Joar Wandborg
0df00eb68f Added tests for HTTP callbacks 2012-09-27 00:45:25 +02:00
Joar Wandborg
a11aa2d17a Added some OAuth plugin tests 2012-09-26 23:53:51 +02:00
Joar Wandborg
30520c92cc Fixed tests
- Adapt tests to new global_config arg for run_dbupdate
- Account for [plugins] not being set in config
2012-09-15 17:54:34 +02:00
Will Kahn-Greene
05d8f314c6 [Issue 466] Implement e-z plugin disabling 2012-07-17 21:14:45 -04:00
Will Kahn-Greene
05e007c1db Rework plugin infrastructure to nix side-effects
This reworks the plugin infrastructure so as to remove module-loading
side-effects which were making things a pain in the ass to test.

With the new system, there's no auto-registering meta class. Instead
plugins do whatever they want and then specify a hooks dict that maps
hook names to callables for the things they're tying into. The most
common one (and the only one we've implemented so far) is "setup".

This also simplifies the sampleplugin a little by moving the code
to __init__.py.
2012-07-17 21:02:12 -04:00
Christopher Allan Webber
35a24fc263 Moving the "dependency injection printer tools" over to tools/common.py 2012-07-14 12:55:14 -05:00
Christopher Allan Webber
5377114c4d Update staticdirect stuff so it can handle "domains" of staticdirection 2012-07-14 12:55:14 -05:00
Jakob Kramer
1e03504e9f removed _make_safe in favor of functools.wraps 2012-07-12 15:01:40 +02:00
Brett Smith
9c7688667e Drop our scoped session sooner to prevent SQLAlchemy re-binding warnings. 2012-07-08 11:00:36 -04:00
Brett Smith
766d9ae7be Prevent SQLAlchemy non-Unicode warnings from this test. 2012-07-08 10:24:57 -04:00
Brett Smith
394512fb02 Prevent SQLAlchemy non-Unicode warnings in this test. 2012-07-08 10:23:02 -04:00
Brett Smith
ed3ff88eed More Unicode titles to prevent non-Unicode SQLAlchemy warnings. 2012-07-08 10:18:33 -04:00
Brett Smith
5bd0adebd0 Prevent non-Unicode SQLAlchemy warnings in most submission tests.
This commit  makes test_submission mostly warning-clean.
2012-07-08 10:04:06 -04:00
Brett Smith
c7dfd4fba6 Level exits are Unicode too. 2012-07-04 11:09:36 -04:00
Brett Smith
a00ac32045 Make sure MigrationManagers always get Unicode names.
If we fail to do this, SQLAlchemy complains that we're binding a
non-Unicode value to a Unicode column.
2012-07-04 10:54:44 -04:00
Joar Wandborg
879ff4bde6 Merge remote-tracking branch 'is_derek/bug405_email_notifications_for_comments' into notifications-merge
Conflicts:
	mediagoblin/db/mongo/migrations.py
2012-06-10 15:53:46 +02:00
Will Kahn-Greene
a855e92a98 Fix problems from pyflakes output 2012-06-03 15:53:34 -04:00
Will Kahn-Greene
29b6f91740 401. Plugin infrastructure
* implements installing, loading and setup for plugins
* codifies configuration
* has a sample plugin
* docs
* tests
2012-05-13 00:00:08 -04:00
Christopher Allan Webber
2eae6ae1ce No need to keep around mongodb migration tests. 2012-04-29 13:05:00 -05:00
Christopher Allan Webber
e089b66bde Merge remote-tracking branch 'refs/remotes/elrond/sql/final'
Conflicts:
	mediagoblin/tests/test_submission.py

Also, WHOO SQL SWITCHOVER PARTY!

        ASCII DANCE PARTY

    /_o_/    \ /   \o_    o
     (       _|_    )    //)
     /\     / o \  /|     /|

      *BMCH BMCH BMCH BMCH*
%
 /_o_/   HHHYAAaaaaa
  /_
 / /
%
AAAAAHAHAHAHAHHHAAHA
       ,,          .------
      o_o ;;       /\\     \    $  __
      '\/ ||      // \\     #     /_/
        \//      // //\\     \
         )             \\     \   %
        \\              \\_____\
        | )            //-------
       /_/_           //     //

       SWITCH YOUR DATABASE
     FLIP A FUKKEN BOOLEAN
%
             __________
          .-'          '-.
        .'                '.
      .'  _--_        _--_  '.
     /   /  (_).     /  (_).  \
    .   |      |    |      |   .
    |    ._____,     ._____,   |
    |   ____________________   |
    |    |                 |   |
    '    \                 /   '
     \    '.        .----./   /
      \     '._    /     /   /
       '.      '--------'  .'
         '._            _.'
            '----------'
2012-04-01 15:36:11 -05:00
Elrond
bc27a100fc Fix unit tests for sql: cache media_id.
Attributes of SQLAlchemy objects get "lost". So "cache"
them locally in the code.
This is really the simple explanation for some scarry
sqlalchemy details.
2012-04-01 22:02:06 +02:00
Joar Wandborg
0308958b2d Fixed test_submission -> test_evil_file test 2012-03-27 16:38:41 +02:00
Joar Wandborg
deea3f6661 Merge remote-tracking branch 'joar/audio+sniffing'
Conflicts:
	mediagoblin/media_types/image/processing.py
	mediagoblin/media_types/video/__init__.py
	mediagoblin/media_types/video/processing.py
	mediagoblin/tests/test_submission.py
2012-03-27 12:05:09 +02:00
Elrond
f4162cb640 Reload the user for current values.
This might not be needed, but it helped at one point.
2012-03-26 20:31:36 +02:00
Elrond
37ef4c66b1 Reload and detach the test user.
The code often needs to know some fields of the test user
even after doing some sql and stuff. The solultion is to
reload it and properly detach it from its Session. That way
all its fields are available and the whole thing is not
connected to a session. It feels like a normal object.
2012-03-26 20:31:35 +02:00
Brett Smith
c16b819663 Merge remote branch 'origin/master' into bug261-resized-filenames
This merge involved moving the new FilenameBuilder class to
processing/__init__.py, and putting the comment deletion tests back into
test_submission.py using the refactored functions.
2012-03-26 14:10:22 -04:00
Brett Smith
28f364bd6d Rename to FilenameBuilder, with a main method named fill.
I think these names better convey what's actually going on.  I updated the
documentation a bit while I was at it.
2012-03-26 13:40:35 -04:00
Christopher Allan Webber
38877794e7 TestSubission's tag check stuff passing now 2012-03-26 11:59:34 -05:00
Christopher Allan Webber
8ea37380bd Remove the user_dev directory on tests ending
(We used to remove the mongo db on tests ending...)
2012-03-26 11:50:36 -05:00
Christopher Allan Webber
8e96bcbc78 Suggest we move to an in-memory database ;) 2012-03-26 11:31:09 -05:00
Christopher Allan Webber
d693f6bd86 SQL based tests and refactored Celery setup stuff
- Changed config files of test configs to use SQL
 - Updated celery initialization tools, factored them to be able to
   use the "big instance" application stuff
2012-03-26 11:14:11 -05:00
Brett Smith
095fbdaf8d Add FilenameMunger class to processing, with tests.
Munging filenames is something all media type processors want to be able to
do, so I'm refactoring it out into a nice bite-sized class.
2012-03-25 12:11:13 -04:00
Joar Wandborg
a9d84d4cb7 Faster sniffing
- Sniffing now goes through the old extension-based filter before
  doing it the bitsniffing way.
- Refractored get_media_type_and_manager(filename).
- Removed ogg extension from video accepted extensions, audio
  will take care of that.
- Added custom audio player, still WIP,but working.
- Added test for sniffing. This only tests for the
  mediagoblin.media_types.image type, as that is the only
  one enabled from start.
2012-03-22 01:27:19 +01:00
Elrond
4114e54df5 And fix the in-celeryd import.
So that celeryd also loads the task.
2012-03-21 12:17:52 +01:00
Brett Smith
6573573dd1 Add tests for image processing. Check filenames and image sizes.
This test helps verify that bug #261 is actually fixed.

In order to test that all the processed images are smaller, I needed to add
an image that's bigger than processing.MEDIUM_SIZE, hence bigblue.png.
2012-03-20 23:59:28 -04:00
Brett Smith
e75d4a0dd5 Make a function to generate test image filenames. 2012-03-20 23:03:11 -04:00
Brett Smith
d1f52dc776 Prefer nose assert_* methods to the assert built-in. 2012-03-20 22:40:32 -04:00
Brett Smith
c373903494 Refactor false image tests. 2012-03-20 22:36:56 -04:00
Brett Smith
c0e87ec9d2 Refactor normal upload tests.
This is nice because it means we do *all* the normal sanity tests for *all*
the normal uploads.  check_url() can be used in other tests too.
2012-03-20 22:30:57 -04:00
Brett Smith
77445d13ad Refactor MediaEntry fetches/checks into check_media(). 2012-03-20 22:16:28 -04:00
Brett Smith
31dd6013b8 Refactor data posts into one do_post function.
All the data posts in these tests had a lot of common code.  Putting all
that into a function makes it easier to write more tests (which I'll be
doing in a bit) and see what's really being tested.
2012-03-20 22:07:32 -04:00
Christopher Allan Webber
94e6052375 Merge branch 'master' into derek-moore-bug405_email_notifications_for_comments
Conflicts:
	mediagoblin/db/mongo/migrations.py
2012-03-18 12:12:41 -05:00
Brett Smith
a0a7f87f62 When media is deleted, delete associated comments too.
The actual code is just a simple for loop; there might be a better
implementation but this is a fine start.  I also extended test_delete to
check this too.
2012-03-17 17:53:00 -04:00
Derek Moore
252eaf21d5 These are changes for issue #405, add email comment notification. 2012-03-15 16:38:56 -07:00
Joar Wandborg
10085b7739 Audio thumbnailing & spectrograms, media plugins use sniffing
* Added extlib/freesound/audioprocessing.py
* config_spec
  * Added create_spectrogram setting
  * Added media:medium and media:thumb max_{width,height} settings
* Added sniffing logic to
  - audio.processing:sniff_handler
  - video.processing:sniff_handler
* Changed audio.processing:sniff_handler logic
* Added audio thumbnailing functionality to audio.processing
  (works only with create_spectrogram enabled)
* Refractored contexts in audio.processing
* Added audio.transcoders:AudioThumbnailer
  Used for creating spectrograms and spectrogram thumbnails -
  Wadsworth's Constant, we meet again :)
* audio.transcoders:AudioTranscoder
  - Added mux_string kwarg
  - Delete self.pipeline on self.halt()
* Changed str.format formatting in image.processing:sniff_handler
  Had {1} without an {0}, changed to {0}
* Refractored VideoTranscoder to use transcode() for transcoding instead
  of __init__()
* Added discover() method to video.transcoders:VideoTranscoder
* Added spectrogram display to media_displays/audio.html
* Updated test_submission to reflect changes in media plugin delegation
2012-02-28 21:59:38 +01:00
Christopher Allan Webber
e9f87f728c Fix tests given recent celery "case" change 2012-02-28 13:31:03 -06:00