You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/05/10 18:05:48 UTC
[4/4] git commit: [#6222] ticket:349 Better tests for merge request
[#6222] ticket:349 Better tests for merge request
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6db9bdf1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6db9bdf1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6db9bdf1
Branch: refs/heads/master
Commit: 6db9bdf1d8f064699b3c33084a5e37393e5fddc5
Parents: f3b0767
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu May 9 08:38:03 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Fri May 10 16:05:13 2013 +0000
----------------------------------------------------------------------
.../forgegit/tests/functional/test_controllers.py | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6db9bdf1/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 d5c8365..b9919aa 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -17,6 +17,8 @@
import json
import re
+import os
+import shutil
import tg
import pkg_resources
@@ -343,6 +345,18 @@ class TestFork(_TestCase):
cloned_from.full_fs_path,
cloned_from.app.config.script_name(),
cloned_from.full_fs_path)
+ # Add commit to a forked repo, thus merge requests will not be empty
+ # clone repo to tmp location first (can't add commit to bare repos directly)
+ clone_path = '/tmp/test2-code-clone'
+ if os.path.exists(clone_path):
+ shutil.rmtree(clone_path)
+ cloned = c.app.repo._impl._git.clone(clone_path)
+ with open(clone_path + '/README', 'w+') as f:
+ f.write('Very useful README')
+ cloned.index.add(['README'])
+ cloned.index.commit('Improve documentation')
+ cloned.remotes[0].push()
+ c.app.repo.refresh()
def _follow(self, r, **kw):
if r.status_int == 302:
@@ -413,6 +427,7 @@ class TestFork(_TestCase):
def test_merge_request_detail_view(self):
r, mr_num = self._request_merge()
assert 'would like you to merge' in r, r.showbrowser()
+ assert 'Improve documentation' in r, r.showbrowser()
def test_merge_request_list_view(self):
r, mr_num = self._request_merge()