jenkins-bot merged this change.

View Change

Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
[tests] Test default -chunked value in uploadscript_tests

Change-Id: I81798ec0d84dcb9907cd135657340b090c1c0b78
---
M tests/uploadscript_tests.py
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/uploadscript_tests.py b/tests/uploadscript_tests.py
index e67b384..0804039 100644
--- a/tests/uploadscript_tests.py
+++ b/tests/uploadscript_tests.py
@@ -18,7 +18,7 @@

net = False

- def match(self, value):
+ def match(self, value=''):
"""Create a match object and call get_chunk_site.

@param value: a chunk size value
@@ -26,12 +26,15 @@
@return: chunk size in bytes
@rtype: int
"""
- option = '-chunked:' + value
+ option = '-chunked'
+ if value:
+ option += ':' + value
match = CHUNK_SIZE_REGEX.match(option)
return get_chunk_size(match)

def test_regex(self):
"""Test CHUNK_SIZE_REGEX and get_chunk_size function."""
+ self.assertEqual(self.match(), 1024 ** 2)
self.assertEqual(self.match('12345'), 12345)
self.assertEqual(self.match('4567k'), 4567 * 1000)
self.assertEqual(self.match('7890m'), 7890 * 10 ** 6)

To view, visit change 482480. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I81798ec0d84dcb9907cd135657340b090c1c0b78
Gerrit-Change-Number: 482480
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)