Page MenuHome

abstract_attract_test.py
No OneTemporary

abstract_attract_test.py

from pillar.tests import PillarTestServer, AbstractPillarTest
MOCK_SVN_URL = 'svn://biserver/mocked'
class AttractTestServer(PillarTestServer):
def __init__(self, *args, **kwargs):
PillarTestServer.__init__(self, *args, **kwargs)
from attract import AttractExtension
self.load_extension(AttractExtension(), '/attract')
class AbstractAttractTest(AbstractPillarTest):
pillar_server_class = AttractTestServer
def tearDown(self):
self.unload_modules('attract')
AbstractPillarTest.tearDown(self)
def ensure_project_exists(self, project_overrides=None):
from attract.setup import setup_for_attract
project_overrides = dict(
picture_header=None,
picture_square=None,
**(project_overrides or {})
)
proj_id, project = AbstractPillarTest.ensure_project_exists(self, project_overrides)
with self.app.test_request_context():
attract_project = setup_for_attract(project['url'],
replace=True,
svn_url=MOCK_SVN_URL)
return proj_id, attract_project

File Metadata

Mime Type
text/x-python
Expires
Mon, Jul 4, 7:11 PM (2 d)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fc/80/8d7a127735411394011ddcc7915e

Event Timeline