From ad5d5f2c998d7d88820323a6f9477bfebc67f0aa Mon Sep 17 00:00:00 2001 From: Tomasz Kolek Date: Fri, 7 Oct 2016 15:30:28 +0200 Subject: [PATCH] Add beanstalk tests for commits more than limit. --- .../beanstalk_git_morethanlimitcommits.json | 871 ++++++++++++++++++ zerver/tests/webhooks/test_beanstalk.py | 18 +- 2 files changed, 885 insertions(+), 4 deletions(-) create mode 100644 zerver/fixtures/beanstalk/beanstalk_git_morethanlimitcommits.json diff --git a/zerver/fixtures/beanstalk/beanstalk_git_morethanlimitcommits.json b/zerver/fixtures/beanstalk/beanstalk_git_morethanlimitcommits.json new file mode 100644 index 0000000000..edeffcb60b --- /dev/null +++ b/zerver/fixtures/beanstalk/beanstalk_git_morethanlimitcommits.json @@ -0,0 +1,871 @@ +{ + "after": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "before": "d190b0f5f1873f809db4050f0b31e89d349381f1", + "branch": "master", + "commits": [ + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + }, + { + "author": { + "email": "lfranchi@kde.org", + "name": "Leo Franchi" + }, + "changed_dirs": [], + "changed_files": [ + [ + "work-test.py", + "edit" + ] + ], + "id": "e50508df24cee0c6e6b1c051ce348282ea152cb3", + "message": "add some stuff", + "timestamp": "2013-04-01T19:21:11Z", + "url": "http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df" + } + ], + "push_is_too_large": false, + "pusher_id": 348341, + "pusher_name": "Leo Franchi", + "ref": "refs/heads/master", + "repository": { + "name": "work-test", + "owner": { + "email": "lfranchi@gmail.com", + "name": "Leo Franchi" + }, + "private": true, + "url": "http://lfranchi-svn.beanstalkapp.com/work-test" + }, + "uri": "git@lfranchi-svn.beanstalkapp.com:/work-test.git" +} diff --git a/zerver/tests/webhooks/test_beanstalk.py b/zerver/tests/webhooks/test_beanstalk.py index 132df65ac4..4a04aa8e2c 100644 --- a/zerver/tests/webhooks/test_beanstalk.py +++ b/zerver/tests/webhooks/test_beanstalk.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from six import text_type +from zerver.lib.webhooks.git import PUSH_COMMITS_LIMIT from zerver.lib.test_helpers import WebhookTestCase class BeanstalkHookTests(WebhookTestCase): @@ -11,8 +12,7 @@ class BeanstalkHookTests(WebhookTestCase): expected_subject = "work-test / master" expected_message = """Leo Franchi [pushed](http://lfranchi-svn.beanstalkapp.com/work-test) to branch master -* [e50508d](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df): add some stuff -""" +* [e50508d](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df): add some stuff""" self.send_and_test_stream_message('git_singlecommit', expected_subject, expected_message, content_type=None, **self.api_auth(self.TEST_USER_EMAIL)) @@ -24,12 +24,22 @@ class BeanstalkHookTests(WebhookTestCase): * [edf529c](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/edf529c7): Added new file * [c2a191b](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/c2a191b9): Filled in new file with some stuff -* [2009815](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/20098158): More work to fix some bugs -""" +* [2009815](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/20098158): More work to fix some bugs""" self.send_and_test_stream_message('git_multiple', expected_subject, expected_message, content_type=None, **self.api_auth(self.TEST_USER_EMAIL)) + def test_git_more_than_limit(self): + # type: () -> None + commits_info = "* [e50508d](http://lfranchi-svn.beanstalkapp.com/work-test/changesets/e50508df): add some stuff\n" + expected_subject = "work-test / master" + expected_message = """Leo Franchi [pushed](http://lfranchi-svn.beanstalkapp.com/work-test) to branch master + +{}[and {} more commit(s)]""".format((commits_info * PUSH_COMMITS_LIMIT), 50 - PUSH_COMMITS_LIMIT) + self.send_and_test_stream_message('git_morethanlimitcommits', expected_subject, expected_message, + content_type=None, + **self.api_auth(self.TEST_USER_EMAIL)) + def test_svn_addremove(self): # type: () -> None expected_subject = "svn r3"