allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [2/7] allura git commit: [#4771] ticket:672 Add test for line numbers in included file
Date Thu, 20 Nov 2014 14:17:27 GMT
[#4771] ticket:672 Add test for line numbers in included file


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/950c9c15
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/950c9c15
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/950c9c15

Branch: refs/heads/ib/4771a
Commit: 950c9c1555929c17f61ee7fbbbe10e26affca933
Parents: 9fdeff0
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Oct 21 13:12:43 2014 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Thu Nov 20 10:50:26 2014 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/tests/functional/test_controllers.py | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/950c9c15/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 632cad5..ca56ff5 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -26,8 +26,10 @@ from nose.tools import assert_equal, assert_in, assert_not_in, assert_not_equal
 import tg
 import pkg_resources
 from pylons import tmpl_context as c
+from pylons import app_globals as g
 from ming.orm import ThreadLocalORMSession
 from mock import patch, PropertyMock
+from BeautifulSoup import BeautifulSoup
 
 from alluratest.controller import setup_global_objects
 from allura import model as M
@@ -805,3 +807,10 @@ class TestIncludeMacro(_TestCase):
         result = macro.include_file('src-git', 'README')
         assert_in('This is readme', result)
         assert_in('Another Line', result)
+
+    def test_include_file_line_nums(self):
+        '''Line numbers inside <pre> must be separated by newline'''
+        result = g.markdown.convert('[[include repo=src-git path=README]]')
+        result = BeautifulSoup(result).find('div', attrs={'class': 'linenodiv'})
+        result = result.find('pre')
+        assert_equal(result.getText(), '1\n2')


Mime
View raw message