You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by he...@apache.org on 2015/06/02 22:07:30 UTC
[39/39] allura git commit: [#7825] Updated tests for commit
notification emails.
[#7825] Updated tests for commit notification emails.
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/fa546c15
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fa546c15
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fa546c15
Branch: refs/heads/hs/7825
Commit: fa546c15f129d51e1c90262d817513da48ad80e9
Parents: 55a78ce
Author: Heith Seewald <hs...@slashdotmedia.com>
Authored: Tue May 26 20:38:27 2015 -0400
Committer: Heith Seewald <hs...@slashdotmedia.com>
Committed: Tue Jun 2 16:06:07 2015 -0400
----------------------------------------------------------------------
ForgeGit/forgegit/tests/functional/test_controllers.py | 4 +---
ForgeGit/forgegit/tests/model/test_repository.py | 10 +++++-----
ForgeSVN/forgesvn/tests/model/test_repository.py | 11 ++++++-----
3 files changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/fa546c15/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 9de228a..69d60b2 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -264,9 +264,7 @@ class TestRootController(_TestCase):
assert '<table class="side-by-side-diff">' in r
def test_refresh(self):
- notification = M.Notification.query.find(
- dict(subject='[test:src-git] 5 new commits to Test Project Git')
- ).first()
+ notification = M.Notification.query.find({'subject': '[test:src-git] 5 new commits to Git'}).first()
assert notification
domain = '.'.join(
reversed(c.app.url[1:-1].split('/'))).replace('_', '-')
http://git-wip-us.apache.org/repos/asf/allura/blob/fa546c15/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index e516f35..dd67987 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -29,7 +29,7 @@ from pylons import tmpl_context as c, app_globals as g
import tg
from ming.base import Object
from ming.orm import ThreadLocalORMSession, session
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_in
from testfixtures import TempDirectory
from datadiff.tools import assert_equals
@@ -368,15 +368,15 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
send_notifications(
self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
ThreadLocalORMSession.flush_all()
- n = M.Notification.query.find(
- dict(subject='[test:src-git] [1e146e] - Rick Copeland: Change README')).first()
+
+ n = M.Notification.query.find({'subject': u'[test:src-git] New commit by Rick Copeland'}).first()
assert n
- assert 'master: ' in n.text, n.text
+ assert_in('Change README', n.text)
send_notifications(
self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
ThreadLocalORMSession.flush_all()
assert M.Notification.query.find(
- dict(subject='[test:src-git] 2 new commits to Test Project Git')).first()
+ dict(subject=u'[test:src-git] 2 new commits to Git')).first()
def test_tarball(self):
tmpdir = tg.config['scm.repos.tarball.root']
http://git-wip-us.apache.org/repos/asf/allura/blob/fa546c15/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 744d30a..476c3f8 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -27,7 +27,7 @@ from zipfile import ZipFile
from collections import defaultdict
from pylons import tmpl_context as c, app_globals as g
import mock
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_in
from datadiff.tools import assert_equals
import tg
import ming
@@ -693,10 +693,10 @@ class TestSVNRev(unittest.TestCase):
ThreadLocalORMSession.flush_all()
send_notifications(self.repo, [self.repo.rev_to_commit_id(1)])
ThreadLocalORMSession.flush_all()
- n = M.Notification.query.find(
- dict(subject='[test:src] [r1] - rick446: Create readme')).first()
+ n = M.Notification.query.find({u'subject': u'[test:src] New commit by rick446'}).first()
assert n
- assert_equal(n.text, 'Create readme http://localhost:8080/p/test/src/1/')
+ assert_in(u'By rick446', n.text)
+ assert_in(u'Create readme', n.text)
class _Test(unittest.TestCase):
@@ -880,7 +880,8 @@ class TestRepo(_TestWithRepo):
notifications = M.Notification.query.find().all()
for n in notifications:
if '100 new commits' in n.subject:
- assert "master,branch: by %s http://localhost:8080/ci/foo99" % committer_name in n.text
+ assert_in(u'By rick446', n.text)
+ assert_in(u'Create readme', n.text)
break
else:
assert False, 'Did not find notification'