[Testbot] Plone 4.3 - Python 2.7 - Build # 2021 - Still failing! - 5 failure(s)
jenkins at plone.org
jenkins at plone.org
Sat Mar 8 20:13:44 UTC 2014
-------------------------------------------------------------------------------
Plone 4.3 - Python 2.7 - Build # 2021 - Still Failing!
-------------------------------------------------------------------------------
http://jenkins.plone.org/job/plone-4.3-python-2.7/2021/
-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------
Repository: plone.batching
Branch: refs/heads/master
Date: 2014-02-28T13:42:39+01:00
Author: Peter Uittenbroek (thepjot) <uittenbroek at goldmund-wyldebeast-wunderliebe.com>
Commit: https://github.com/plone/plone.batching/commit/f28503ae898d0ce015d0c991c0a6f950c760ed88
Fix for dev.plone.org #13880. When start >= end, you get last result due to fault self.first
Files changed:
M plone/batching/batch.py
M plone/batching/tests.py
diff --git a/plone/batching/batch.py b/plone/batching/batch.py
index 07f4c3d..7c6d0f6 100644
--- a/plone/batching/batch.py
+++ b/plone/batching/batch.py
@@ -51,6 +51,8 @@ def initialize(self, start, end, size):
self.end = end
self.first = max(start - 1, 0)
+ if self.start == self.end:
+ self.first = self.end
self.length = self.end - self.first
self.last = self.sequence_length - size
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index 2d6e526..d8c360e 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -104,6 +104,21 @@ def test_items_not_on_page(self):
self.assertEqual(list(batch), [5, 6, 7, 8, 9])
+ def test_batch_bsize(self):
+ sequence = range(279)
+ # Random page
+ batch = BaseBatch(sequence, 10, start=80)
+ self.assertEqual(batch.length, 10)
+
+ # Last page
+ batch = BaseBatch(sequence, 10, start=270)
+ self.assertEqual(batch.length, 9)
+
+ # Beyond last page
+ batch = BaseBatch(sequence, 10, start=280)
+ self.assertEqual(batch.length, 0)
+
+
class TestQuantumBatch(unittest.TestCase):
def test_quantumbatch(self):
@@ -112,6 +127,7 @@ def test_quantumbatch(self):
self.assertEqual(qbatch.leapforward, [54])
+
class DummyTemplate(object):
macros = 'here are PT macros normally'
Repository: plone.batching
Branch: refs/heads/master
Date: 2014-02-28T13:44:58+01:00
Author: Peter Uittenbroek (thepjot) <uittenbroek at goldmund-wyldebeast-wunderliebe.com>
Commit: https://github.com/plone/plone.batching/commit/d8d668e293dcc11a9c76adb057b82486d3f2f692
Update changes
Files changed:
M CHANGES.rst
diff --git a/CHANGES.rst b/CHANGES.rst
index 9fa2b30..ac9a5fe 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,9 @@ Changelog
1.0.2 (unreleased)
------------------
-- Nothing changed yet.
+- Fix issue where a start >= end will always return last item.
+ https://dev.plone.org/ticket/13880\
+ [thepjot]
1.0.1 (2014-01-27)
Repository: plone.batching
Branch: refs/heads/master
Date: 2014-02-28T13:45:23+01:00
Author: Peter Uittenbroek (thepjot) <uittenbroek at goldmund-wyldebeast-wunderliebe.com>
Commit: https://github.com/plone/plone.batching/commit/7457f419f749088e0778a569a6d274919bc51e1f
Empty space
Files changed:
M plone/batching/tests.py
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index d8c360e..e22cdc1 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -127,7 +127,6 @@ def test_quantumbatch(self):
self.assertEqual(qbatch.leapforward, [54])
-
class DummyTemplate(object):
macros = 'here are PT macros normally'
Repository: plone.batching
Branch: refs/heads/master
Date: 2014-03-05T13:30:59+01:00
Author: Peter Uittenbroek (thepjot) <uittenbroek at goldmund-wyldebeast-wunderliebe.com>
Commit: https://github.com/plone/plone.batching/commit/3eaaab6fe7d80f1aa0fa74ee2cabe274c51f8853
Improve testing for single item batch. Only fix self.first if sequence is bigger than one
Files changed:
M plone/batching/batch.py
M plone/batching/tests.py
diff --git a/plone/batching/batch.py b/plone/batching/batch.py
index 7c6d0f6..4f1c892 100644
--- a/plone/batching/batch.py
+++ b/plone/batching/batch.py
@@ -51,7 +51,7 @@ def initialize(self, start, end, size):
self.end = end
self.first = max(start - 1, 0)
- if self.start == self.end:
+ if self.start == self.end and self.sequence_length > 1:
self.first = self.end
self.length = self.end - self.first
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index e22cdc1..1cbe2a7 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -118,6 +118,10 @@ def test_batch_bsize(self):
batch = BaseBatch(sequence, 10, start=280)
self.assertEqual(batch.length, 0)
+ # Single item batch
+ batch = BaseBatch(sequence[0:1], 10)
+ self.assertEqual(batch.length, 1)
+
class TestQuantumBatch(unittest.TestCase):
Repository: plone.batching
Branch: refs/heads/master
Date: 2014-03-08T11:26:34-08:00
Author: David Glick (davisagli) <david at glicksoftware.com>
Commit: https://github.com/plone/plone.batching/commit/1d8abf8bfdd5e39578b3e7a9d9a0186d52a4bd2c
Merge pull request #1 from plone/fix-13880
Fix 13880
Files changed:
M CHANGES.rst
M plone/batching/batch.py
M plone/batching/tests.py
diff --git a/CHANGES.rst b/CHANGES.rst
index 9fa2b30..ac9a5fe 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,7 +4,9 @@ Changelog
1.0.2 (unreleased)
------------------
-- Nothing changed yet.
+- Fix issue where a start >= end will always return last item.
+ https://dev.plone.org/ticket/13880\
+ [thepjot]
1.0.1 (2014-01-27)
diff --git a/plone/batching/batch.py b/plone/batching/batch.py
index 07f4c3d..4f1c892 100644
--- a/plone/batching/batch.py
+++ b/plone/batching/batch.py
@@ -51,6 +51,8 @@ def initialize(self, start, end, size):
self.end = end
self.first = max(start - 1, 0)
+ if self.start == self.end and self.sequence_length > 1:
+ self.first = self.end
self.length = self.end - self.first
self.last = self.sequence_length - size
diff --git a/plone/batching/tests.py b/plone/batching/tests.py
index 2d6e526..1cbe2a7 100644
--- a/plone/batching/tests.py
+++ b/plone/batching/tests.py
@@ -104,6 +104,25 @@ def test_items_not_on_page(self):
self.assertEqual(list(batch), [5, 6, 7, 8, 9])
+ def test_batch_bsize(self):
+ sequence = range(279)
+ # Random page
+ batch = BaseBatch(sequence, 10, start=80)
+ self.assertEqual(batch.length, 10)
+
+ # Last page
+ batch = BaseBatch(sequence, 10, start=270)
+ self.assertEqual(batch.length, 9)
+
+ # Beyond last page
+ batch = BaseBatch(sequence, 10, start=280)
+ self.assertEqual(batch.length, 0)
+
+ # Single item batch
+ batch = BaseBatch(sequence[0:1], 10)
+ self.assertEqual(batch.length, 1)
+
+
class TestQuantumBatch(unittest.TestCase):
def test_quantumbatch(self):
-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 6603 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140308/5a0d12bd/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 79890 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140308/5a0d12bd/attachment-0003.obj>
More information about the Testbot
mailing list