Mercurial > public > mercurial-scm > hg
diff tests/test-cbor.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 6dbb18e1ac8d |
children | 6000f5b25c9b |
line wrap: on
line diff
--- a/tests/test-cbor.py Fri Nov 27 17:00:00 2020 -0500 +++ b/tests/test-cbor.py Fri Nov 27 17:03:29 2020 -0500 @@ -690,7 +690,12 @@ self.assertEqual( list(cborutil.streamencodearrayfromiter(source)), - [b'\x9f', b'\x43', b'foo', b'\xff',], + [ + b'\x9f', + b'\x43', + b'foo', + b'\xff', + ], ) dest = b''.join(cborutil.streamencodearrayfromiter(source)) @@ -799,7 +804,11 @@ class SetTests(TestCase): def testempty(self): self.assertEqual( - list(cborutil.streamencode(set())), [b'\xd9\x01\x02', b'\x80',] + list(cborutil.streamencode(set())), + [ + b'\xd9\x01\x02', + b'\x80', + ], ) self.assertEqual(cborutil.decodeall(b'\xd9\x01\x02\x80'), [set()]) @@ -914,14 +923,26 @@ ): cborutil.decodeall(encoded) - encoded = b''.join([b'\xd9\x01\x02', b'\x81', b'\x80',]) # empty array + encoded = b''.join( + [ + b'\xd9\x01\x02', + b'\x81', + b'\x80', + ] + ) # empty array with self.assertRaisesRegex( cborutil.CBORDecodeError, 'collections not allowed as set values' ): cborutil.decodeall(encoded) - encoded = b''.join([b'\xd9\x01\x02', b'\x81', b'\xa0',]) # empty map + encoded = b''.join( + [ + b'\xd9\x01\x02', + b'\x81', + b'\xa0', + ] + ) # empty map with self.assertRaisesRegex( cborutil.CBORDecodeError, 'collections not allowed as set values' @@ -1059,7 +1080,13 @@ ): cborutil.decodeall(encoded) - encoded = b''.join([b'\xa1', b'\x80', b'\x43foo',]) # empty array + encoded = b''.join( + [ + b'\xa1', + b'\x80', + b'\x43foo', + ] + ) # empty array with self.assertRaisesRegex( cborutil.CBORDecodeError, 'collections not supported as map keys' @@ -1260,7 +1287,10 @@ def testpartialinput(self): encoded = b''.join( - [b'\x82', b'\x01',] # array of 2 elements # integer 1 + [ + b'\x82', + b'\x01', + ] # array of 2 elements # integer 1 ) with self.assertRaisesRegex(