allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [37/50] git commit: [#1968] ticket:159 add tests
Date Wed, 19 Sep 2012 18:43:27 GMT
[#1968] ticket:159 add tests


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

Branch: refs/heads/master
Commit: 7ae663828b7538c71c120c3a29c6aab678bb897d
Parents: b36ffaf
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Sun Sep 2 02:56:44 2012 +0400
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Mon Sep 10 15:35:15 2012 +0000

----------------------------------------------------------------------
 .../forgegit/tests/functional/test_controllers.py  |    6 --
 .../tests/data/paginationtest.hg/.hg/00changelog.i |  Bin 0 -> 57 bytes
 .../tests/data/paginationtest.hg/.hg/branch        |    1 +
 .../data/paginationtest.hg/.hg/branchheads.cache   |    2 +
 .../tests/data/paginationtest.hg/.hg/dirstate      |  Bin 0 -> 63 bytes
 .../forgehg/tests/data/paginationtest.hg/.hg/hgrc  |    5 ++
 .../tests/data/paginationtest.hg/.hg/requires      |    3 +
 .../data/paginationtest.hg/.hg/store/00changelog.i |  Bin 0 -> 3839 bytes
 .../data/paginationtest.hg/.hg/store/00manifest.i  |  Bin 0 -> 2938 bytes
 .../.hg/store/data/_r_e_a_d_m_e.i                  |  Bin 0 -> 2093 bytes
 .../tests/data/paginationtest.hg/.hg/store/fncache |    1 +
 .../tests/data/paginationtest.hg/.hg/store/undo    |  Bin 0 -> 56 bytes
 .../tests/data/paginationtest.hg/.hg/tags.cache    |    2 +
 .../tests/data/paginationtest.hg/.hg/undo.branch   |    1 +
 .../tests/data/paginationtest.hg/.hg/undo.dirstate |  Bin 0 -> 63 bytes
 .../forgehg/tests/data/paginationtest.hg/README    |   26 ++++++++
 .../forgehg/tests/functional/test_controllers.py   |   46 +++++++++++++++
 17 files changed, 87 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/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 866312b..6c136b5 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -95,12 +95,6 @@ class TestRootController(_TestCase):
     def test_log(self):
         resp = self.app.get('/src-git/ref/master~/log/')
 
-    def test_limit_log(self):
-        resp = self.app.get(self._get_ci()+'log/')
-        assert "pager_curpage" not in resp
-        resp = self.app.get(self._get_ci()+'log/?limit=1')
-        assert "pager_curpage" in resp
-
     def test_tags(self):
         resp = self.app.get('/src-git/ref/master~/tags/')
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/00changelog.i
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/00changelog.i b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/00changelog.i
new file mode 100644
index 0000000..d3a8311
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/00changelog.i
differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branch
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branch b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branch
new file mode 100644
index 0000000..4ad96d5
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branch
@@ -0,0 +1 @@
+default

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branchheads.cache
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branchheads.cache b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branchheads.cache
new file mode 100644
index 0000000..1145ccf
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/branchheads.cache
@@ -0,0 +1,2 @@
+0debe4adbedc5d711d2e379027cc3c6cca26f89a 25
+0debe4adbedc5d711d2e379027cc3c6cca26f89a default

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/dirstate
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/dirstate b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/dirstate
new file mode 100644
index 0000000..0cf5f0f
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/dirstate differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/hgrc
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/hgrc b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/hgrc
new file mode 100644
index 0000000..ef8389f
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/hgrc
@@ -0,0 +1,5 @@
+[paths]
+default = /tmp/hg/p/allura/code
+
+[ui]
+username = Yuriy Arhipov

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/requires
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/requires b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/requires
new file mode 100644
index 0000000..5175383
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/requires
@@ -0,0 +1,3 @@
+revlogv1
+store
+fncache

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00changelog.i
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00changelog.i b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00changelog.i
new file mode 100644
index 0000000..144616a
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00changelog.i
differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00manifest.i
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00manifest.i b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00manifest.i
new file mode 100644
index 0000000..99e3081
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/00manifest.i
differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/data/_r_e_a_d_m_e.i
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/data/_r_e_a_d_m_e.i b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/data/_r_e_a_d_m_e.i
new file mode 100644
index 0000000..fe88f6b
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/data/_r_e_a_d_m_e.i
differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/fncache
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/fncache b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/fncache
new file mode 100644
index 0000000..fb1271b
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/fncache
@@ -0,0 +1 @@
+data/README.i

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/undo
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/undo b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/undo
new file mode 100644
index 0000000..d211ad9
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/store/undo differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/tags.cache
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/tags.cache b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/tags.cache
new file mode 100644
index 0000000..ef32d42
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/tags.cache
@@ -0,0 +1,2 @@
+25 0debe4adbedc5d711d2e379027cc3c6cca26f89a
+

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.branch
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.branch b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.branch
new file mode 100644
index 0000000..331d858
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.branch
@@ -0,0 +1 @@
+default
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.dirstate
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.dirstate b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.dirstate
new file mode 100644
index 0000000..8bbf7d8
Binary files /dev/null and b/ForgeHg/forgehg/tests/data/paginationtest.hg/.hg/undo.dirstate
differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/data/paginationtest.hg/README
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/data/paginationtest.hg/README b/ForgeHg/forgehg/tests/data/paginationtest.hg/README
new file mode 100644
index 0000000..9f52852
--- /dev/null
+++ b/ForgeHg/forgehg/tests/data/paginationtest.hg/README
@@ -0,0 +1,26 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7ae66382/ForgeHg/forgehg/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeHg/forgehg/tests/functional/test_controllers.py b/ForgeHg/forgehg/tests/functional/test_controllers.py
index b1890fb..bf86c1a 100644
--- a/ForgeHg/forgehg/tests/functional/test_controllers.py
+++ b/ForgeHg/forgehg/tests/functional/test_controllers.py
@@ -174,3 +174,49 @@ class TestRootController(TestController):
         assert 'Cannot display: file marked as a binary type.' in resp
 
 
+class TestLogPagination(TestController):
+
+    def setUp(self):
+        TestController.setUp(self)
+        self.setup_with_tools()
+
+    @td.with_hg
+    def setup_with_tools(self):
+        h.set_context('test', 'src-hg', neighborhood='Projects')
+        repo_dir = pkg_resources.resource_filename(
+            'forgehg', 'tests/data')
+        c.app.repo.fs_path = repo_dir
+        c.app.repo.status = 'ready'
+        c.app.repo.name = 'paginationtest.hg'
+        c.app.repo.refresh()
+        ThreadLocalORMSession.flush_all()
+        ThreadLocalORMSession.close_all()
+        h.set_context('test', 'src-hg', neighborhood='Projects')
+        c.app.repo.refresh()
+
+    def _get_ci(self):
+        resp = self.app.get('/src-hg/').follow().follow()
+        for tag in resp.html.findAll('a'):
+            if tag['href'].startswith('/p/test/src-hg/ci/'):
+                return tag['href']
+        return None
+
+    def test_show_pagination(self):
+        resp = self.app.get(self._get_ci() + 'log/')
+        assert "pager_curpage" in resp
+        resp = self.app.get(self._get_ci() + 'log/?limit=50')
+        assert "pager_curpage" not in resp
+        resp = self.app.get(self._get_ci() + 'log/?page=2')
+        assert "pager_curpage" not in resp
+
+    def test_log_messages(self):
+        resp = self.app.get(self._get_ci() + 'log/')
+        assert "[0debe4]" in resp
+        assert "[ab7517]" in resp
+        assert "[dc406e]" not in resp
+        resp = self.app.get(self._get_ci() + 'log/?page=1')
+        assert "[0debe4]" not in resp
+        assert "[dc406e]" in resp
+        resp = self.app.get(self._get_ci() + 'log/?limit=50')
+        assert "[0debe4]" in resp
+        assert "[dc406e]" in resp


Mime
View raw message