Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(3)  |  Derive(0)  |  Import(3)

src/m/e/mediadrop-HEAD/mediadrop/lib/tests/request_mixin_test.py   mediadrop(Download)
import re
 
from mediadrop.lib.attribute_dict import AttrDict
from mediadrop.lib.helpers import has_permission
from mediadrop.lib.test.db_testcase import DBTestCase
    def test_can_encode_file(self):
        fake_fp = AttrDict(name='foo.txt', read=lambda: 'foobar')
        results = self.encode_and_parse([('file', fake_fp)])
        assert_equals(dict(file='foobar'), results)
 

src/m/e/mediadrop-HEAD/mediadrop/controllers/tests/upload_test.py   mediadrop(Download)
import simplejson
 
from mediadrop.lib.attribute_dict import AttrDict
from mediadrop.lib.players import AbstractFlashPlayer, FlowPlayer
from mediadrop.lib.test import ControllerTestCase
            description = 'a great song',
            url = '',
            file = AttrDict(read=fake_file.read, filename='awesome-song.mp3'),
        )
        return parameters

src/m/e/mediadrop-HEAD/mediadrop/lib/auth/tests/permission_system_test.py   mediadrop(Download)
# See LICENSE.txt in the main project directory, for more information.
 
from mediadrop.lib.attribute_dict import AttrDict
from mediadrop.lib.auth.api import IPermissionPolicy, PermissionSystem, Resource,\
    UserPermissions
    def setUp(self):
        self.system = PermissionSystem([])
        user = AttrDict(groups=[])
        self.perm = UserPermissions(user, self.system)