Added AbstractAttractTest.attract property

This commit is contained in:
2016-11-10 15:33:25 +01:00
parent 6628ce0b15
commit 72e903d192
5 changed files with 11 additions and 7 deletions

View File

@@ -22,6 +22,10 @@ class AbstractAttractTest(AbstractPillarTest):
AbstractPillarTest.tearDown(self)
@property
def attract(self):
return self.app.pillar_extensions['attract']
def ensure_project_exists(self, project_overrides=None):
from attract.setup import setup_for_attract

View File

@@ -25,7 +25,7 @@ class ShortcodeTest(AbstractAttractTest):
def setUp(self, **kwargs):
AbstractAttractTest.setUp(self, **kwargs)
self.mngr = self.app.pillar_extensions['attract'].task_manager
self.mngr = self.attract.task_manager
self.proj_id, self.project = self.ensure_project_exists()
def test_increment_simple(self):

View File

@@ -18,8 +18,8 @@ class AbstractShotTest(AbstractAttractTest):
def setUp(self, **kwargs):
AbstractAttractTest.setUp(self, **kwargs)
self.tmngr = self.app.pillar_extensions['attract'].task_manager
self.smngr = self.app.pillar_extensions['attract'].shot_manager
self.tmngr = self.attract.task_manager
self.smngr = self.attract.shot_manager
self.proj_id, self.project = self.ensure_project_exists()
@@ -190,7 +190,7 @@ class PatchShotTest(AbstractShotTest):
self.patch(url, json=patch, auth_token='token')
with self.app.test_request_context():
acts = self.app.pillar_extensions['attract'].activities_for_node(shot._id)
acts = self.attract.activities_for_node(shot._id)
self.assertEqual(2, acts['_meta']['total']) # Creation + edit
edit_act = acts['_items'][1]
self.assertIn(old_name, edit_act['verb'])

View File

@@ -202,7 +202,7 @@ class PushCommitTest(AbstractAttractTest):
def setUp(self, **kwargs):
AbstractAttractTest.setUp(self, **kwargs)
self.mngr = self.app.pillar_extensions['attract'].task_manager
self.mngr = self.attract.task_manager
self.proj_id, self.project = self.ensure_project_exists()
def test_push_happy(self):

View File

@@ -18,7 +18,7 @@ class TaskWorkflowTest(AbstractAttractTest):
def setUp(self, **kwargs):
AbstractAttractTest.setUp(self, **kwargs)
self.mngr = self.app.pillar_extensions['attract'].task_manager
self.mngr = self.attract.task_manager
self.proj_id, self.project = self.ensure_project_exists()
self.sdk_project = pillarsdk.Project(pillar.tests.mongo_to_sdk(self.project))
@@ -106,7 +106,7 @@ class TaskWorkflowTest(AbstractAttractTest):
_etag=task._etag)
with self.app.test_request_context():
acts = self.app.pillar_extensions['attract'].activities_for_node(task['_id'])
acts = self.attract.activities_for_node(task['_id'])
self.assertEqual(2, acts['_meta']['total']) # Creation + edit
edit_act = acts['_items'][1]