jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/482480 )
Change subject: [tests] Test default -chunked value in uploadscript_tests ......................................................................
[tests] Test default -chunked value in uploadscript_tests
Change-Id: I81798ec0d84dcb9907cd135657340b090c1c0b78 --- M tests/uploadscript_tests.py 1 file changed, 5 insertions(+), 2 deletions(-)
Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
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)