Ejemplo n.º 1
0
    def test_notification_email(self):
        send_notifications(
            self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
        ThreadLocalORMSession.flush_all()

        n = M.Notification.query.find({'subject': u'[test:src-git] New commit [1e146e] by Rick Copeland'}).first()
        assert n
        assert_in('Change README', n.text)
Ejemplo n.º 2
0
    def test_notification_email(self):
        send_notifications(
            self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
        ThreadLocalORMSession.flush_all()

        n = M.Notification.query.find({'subject': '[test:src-git] New commit [1e146e] by Rick Copeland'}).first()
        assert n
        assert_in('Change README', n.text)
Ejemplo n.º 3
0
 def test_notification_email_multiple_commits(self):
     send_notifications(self.repo, ['df30427c488aeab84b2352bdf88a3b19223f9d7a',
                                    '1e146e67985dcd71c74de79613719bef7bddca4a',
                                    ])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find(
         dict(subject='[test:src-git] 2 new commits to Git')).first()
     assert n
     assert n.text.startswith('\n## Branch: master'), n.text
     assert n.text.find('Add README') < n.text.find('Change README'), n.text
Ejemplo n.º 4
0
 def test_notification_email_multiple_commits(self):
     send_notifications(self.repo, ['df30427c488aeab84b2352bdf88a3b19223f9d7a',
                                    '1e146e67985dcd71c74de79613719bef7bddca4a',
                                    ])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find(
         dict(subject=u'[test:src-git] 2 new commits to Git')).first()
     assert n
     assert n.text.startswith('\n## Branch: master'), n.text
     assert n.text.find('Add README') < n.text.find('Change README'), n.text
 def test_notification_email(self):
     send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find(
         dict(subject='[test:src-git] [1e146e] - Rick Copeland: Change README')).first()
     assert n
     assert 'master: ' in n.text, 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()
Ejemplo n.º 6
0
 def test_notification_email_max_commits(self):
     send_notifications(self.repo, ['9a7df788cf800241e3bb5a849c8870f2f8259d98',
                                    '6a45885ae7347f1cac5103b0050cc1be6a1496c8',
                                    'df30427c488aeab84b2352bdf88a3b19223f9d7a',
                                    '1e146e67985dcd71c74de79613719bef7bddca4a',
                                    ])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find(
         dict(subject='[test:src-git] 4 new commits to Git')).first()
     assert n
     assert n.text.startswith('\n## Branch: master'), n.text
     assert n.text.endswith('And 1 more commits.\n'), n.text
Ejemplo n.º 7
0
 def test_notification_email_max_commits(self):
     send_notifications(self.repo, ['9a7df788cf800241e3bb5a849c8870f2f8259d98',
                                    '6a45885ae7347f1cac5103b0050cc1be6a1496c8',
                                    'df30427c488aeab84b2352bdf88a3b19223f9d7a',
                                    '1e146e67985dcd71c74de79613719bef7bddca4a',
                                    ])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find(
         dict(subject=u'[test:src-git] 4 new commits to Git')).first()
     assert n
     assert n.text.startswith('\n## Branch: master'), n.text
     assert n.text.endswith('And 1 more commits.\n'), n.text
Ejemplo n.º 8
0
 def test_notification_email(self):
     send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
     ThreadLocalORMSession.flush_all()
     notifications = M.Notification.query.find().sort('pubdate')
     n = notifications.all()[2]
     assert_equal(n.subject, '[test:src-git] [1e146e] - Rick Copeland: Change README')
     assert 'master,zz: ' in n.text
     send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
     ThreadLocalORMSession.flush_all()
     notifications = M.Notification.query.find().sort('pubdate')
     n = notifications.all()[3]
     assert_equal(n.subject, '[test:src-git] 2 new commits to test Git')
Ejemplo n.º 9
0
    def test_notification_email(self):
        send_notifications(
            self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
        ThreadLocalORMSession.flush_all()

        n = M.Notification.query.find({'subject': u'[test:src-git] New commit by Rick Copeland'}).first()
        assert n
        assert_in('Change README', n.text)
        send_notifications(
            self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
        ThreadLocalORMSession.flush_all()
        assert M.Notification.query.find(
            dict(subject=u'[test:src-git] 2 new commits to Git')).first()
Ejemplo n.º 10
0
    def test_notification_email(self):
        send_notifications(
            self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
        ThreadLocalORMSession.flush_all()

        n = M.Notification.query.find({'subject': u'[test:src-git] New commit by Rick Copeland'}).first()
        assert n
        assert_in('Change README', n.text)
        send_notifications(
            self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
        ThreadLocalORMSession.flush_all()
        assert M.Notification.query.find(
            dict(subject=u'[test:src-git] 2 new commits to Git')).first()
Ejemplo n.º 11
0
 def test_notification_email(self):
     setup_global_objects()
     h.set_context('test', 'src', neighborhood='Projects')
     repo_dir = pkg_resources.resource_filename('forgesvn', 'tests/data/')
     self.repo = SM.Repository(name='testsvn',
                               fs_path=repo_dir,
                               url_path='/test/',
                               tool='svn',
                               status='creating')
     self.repo.refresh()
     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()
     assert n
     assert_equal(n.text, 'Create readme http://localhost/p/test/src/1/')
Ejemplo n.º 12
0
 def test_notification_email(self):
     setup_global_objects()
     h.set_context('test', 'src', neighborhood='Projects')
     repo_dir = pkg_resources.resource_filename(
         'forgesvn', 'tests/data/')
     self.repo = SM.Repository(
         name='testsvn',
         fs_path=repo_dir,
         url_path = '/test/',
         tool = 'svn',
         status = 'creating')
     self.repo.refresh()
     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()
     assert n
     assert_equal(n.text, 'Create readme http://localhost/p/test/src/1/')
Ejemplo n.º 13
0
 def test_notification_email(self):
     send_notifications(self.repo, [
         '1e146e67985dcd71c74de79613719bef7bddca4a',
     ])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find(
         dict(
             subject='[test:src-git] [1e146e] - Rick Copeland: Change README'
         )).first()
     assert n
     assert 'master: ' in n.text, 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()
Ejemplo n.º 14
0
 def test_notification_email(self):
     setup_global_objects()
     h.set_context('test', 'src', neighborhood='Projects')
     repo_dir = pkg_resources.resource_filename(
         'forgesvn', 'tests/data/')
     self.repo = SM.Repository(
         name='testsvn',
         fs_path=repo_dir,
         url_path='/test/',
         tool='svn',
         status='creating')
     self.repo.refresh()
     ThreadLocalORMSession.flush_all()
     send_notifications(self.repo, [self.repo.rev_to_commit_id(1)])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find({u'subject': u'[test:src] New commit by rick446'}).first()
     assert n
     assert_in(u'By rick446', n.text)
     assert_in(u'Create readme', n.text)
Ejemplo n.º 15
0
 def test_notification_email(self):
     setup_global_objects()
     h.set_context('test', 'src', neighborhood='Projects')
     repo_dir = pkg_resources.resource_filename('forgesvn', 'tests/data/')
     self.repo = SM.Repository(name='testsvn',
                               fs_path=repo_dir,
                               url_path='/test/',
                               tool='svn',
                               status='creating')
     self.repo.refresh()
     ThreadLocalORMSession.flush_all()
     send_notifications(self.repo, [self.repo.rev_to_commit_id(1)])
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.find({
         u'subject':
         u'[test:src] New commit by rick446'
     }).first()
     assert n
     assert_in(u'By rick446', n.text)
     assert_in(u'Create readme', n.text)