376 Commits

Author SHA1 Message Date
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
Elrond
34344f1d85 Merge remote-tracking branch 'cwebber/celerysql'
* cwebber/celerysql:
  Adjust unit tests to match new celery/kombu sqlalchemy setup
  "database" is not the sqlalchemy kombu transport... should be "sqlalchemy"
  Celery and kombu databases should also be .gitignore'd
  kombu-sqlalchemy a requirement in order for kombu sqlalchemy transport to work
  Move mediagoblin dbs out of user_dev for race condition directory-creation reasons.
  Give kombu its own db.  Responding to Elrond "sqlite will lock all the time!" :)
  Apparently an absolute path is three slashes after sqlite:.  Thx elrond.
  Should be all that's needed to switch celery/kombu settings to sqlalchemy
2012-02-27 21:55:02 +01:00
Christopher Allan Webber
a9a63a686e Adjust unit tests to match new celery/kombu sqlalchemy setup 2012-02-26 15:45:58 -06:00
Elrond
8efcd40558 Dot-Notation: MediaComment and some random places 2012-02-26 19:19:48 +01:00
Christopher Allan Webber
d2506eebb4 Commenting out the migrations that don't exist yet 2012-02-18 23:19:41 -06:00
Christopher Allan Webber
63352aaf70 Merge branch 'master' into sqlmigrate
Conflicts:
	mediagoblin/db/sql/models.py
2012-02-18 10:01:47 -06:00
Will Kahn-Greene
7f4ebeed76 Fix copyright statements; add LICENSE for EXIF.py 2012-02-08 10:47:08 -05:00
Elrond
ccca39f1d8 Fix EXIF based image rotation test
The test checks for a pixel value after rotation (good
idea!). But the value seems to be a bit different on some
platforms, so use a list of seen values.

Not the perfect solution, but it works.
2012-02-04 21:37:05 +01:00
Christopher Allan Webber
cf29e8a824 It's 2012 all up in here 2012-02-02 09:44:13 -06:00
Christopher Allan Webber
7f3ec607a3 Explained why migration #1 commented out. 2012-01-29 22:19:53 -06:00
Christopher Allan Webber
78d17b8055 Excepting that migration 1 doesn't work(!), sqlalchemy migration branch working
The reason migration 1 doesn't work, and is commented out, is because
of sqlalchemy-migrate not handling certain constraints while dropping
binary sqlite columns right.  See also:
http://code.google.com/p/sqlalchemy-migrate/issues/detail?id=143&thanks=143&ts=1327882242
2012-01-29 22:19:03 -06:00
Christopher Allan Webber
e920b96859 db_conn.engine -> db_conn.bind 2012-01-29 17:28:25 -06:00
Christopher Allan Webber
be1077ac44 Migration manager's current migration should be 3, not 7, after running all migrations! 2012-01-29 17:23:27 -06:00
Christopher Allan Webber
505c0db119 Fixed the descriptions for the necroplex! 2012-01-29 17:22:29 -06:00
Christopher Allan Webber
c7fa585bff assert column type from Unicode -> VARCHAR. SQLAlchemy reflection only so smart ;) 2012-01-29 17:21:44 -06:00
Christopher Allan Webber
ecb4cc8990 printer = CollectingPrinter -> printer = CollectingPrinter() 2012-01-29 17:11:41 -06:00
Christopher Allan Webber
245e6d83a6 CollectingPrinter is a class, not a function! 2012-01-29 17:10:18 -06:00
Christopher Allan Webber
0f3526c601 magical_powers relationship set on wrong table, fixed 2012-01-29 16:48:44 -06:00
Christopher Allan Webber
a5e03db6c2 Migration records are dicts, not lists. Fix SET1_MIGATIONS! 2012-01-29 16:39:08 -06:00
Christopher Allan Webber
e8e52b3a0b test_set1_to_set3() now has appropriate amount of code, even if it doesn't run :) 2012-01-29 16:33:47 -06:00
Christopher Allan Webber
caed154af0 Fixing some obvious errors caught by pyflakes 2012-01-29 16:33:47 -06:00
Christopher Allan Webber
5de0f4daf5 More stuff even yet per sql migration stuff! And still not ready! 2012-01-29 16:33:47 -06:00
Christopher Allan Webber
690b51faa7 Closer to the end of this migration test... 2012-01-29 16:33:47 -06:00
Christopher Allan Webber
94eff10deb unicode stuff and more bits on the actual migration method 2012-01-29 16:33:47 -06:00