[Python-checkins] r80123 - python/trunk/Lib/test/test_bytes.py

benjamin.peterson python-checkins at python.org
Sat Apr 17 00:24:17 CEST 2010


Author: benjamin.peterson
Date: Sat Apr 17 00:24:16 2010
New Revision: 80123

Log:
bytearray -> type2test

Modified:
   python/trunk/Lib/test/test_bytes.py

Modified: python/trunk/Lib/test/test_bytes.py
==============================================================================
--- python/trunk/Lib/test/test_bytes.py	(original)
+++ python/trunk/Lib/test/test_bytes.py	Sat Apr 17 00:24:16 2010
@@ -62,17 +62,17 @@
         b = self.type2test([Indexable(), Indexable(1), Indexable(254),
                             Indexable(255)])
         self.assertEqual(list(b), [0, 1, 254, 255])
-        self.assertRaises(ValueError, bytearray, [Indexable(-1)])
-        self.assertRaises(ValueError, bytearray, [Indexable(256)])
+        self.assertRaises(ValueError, self.type2test, [Indexable(-1)])
+        self.assertRaises(ValueError, self.type2test, [Indexable(256)])
 
     def test_from_ssize(self):
-        self.assertEqual(bytearray(0), b'')
-        self.assertEqual(bytearray(1), b'\x00')
-        self.assertEqual(bytearray(5), b'\x00\x00\x00\x00\x00')
-        self.assertRaises(ValueError, bytearray, -1)
+        self.assertEqual(self.type2test(0), b'')
+        self.assertEqual(self.type2test(1), b'\x00')
+        self.assertEqual(self.test2test(5), b'\x00\x00\x00\x00\x00')
+        self.assertRaises(ValueError, self.type2test, -1)
 
-        self.assertEqual(bytearray('0', 'ascii'), b'0')
-        self.assertEqual(bytearray(b'0'), b'0')
+        self.assertEqual(self.type2test('0', 'ascii'), b'0')
+        self.assertEqual(self.type2test(b'0'), b'0')
 
     def test_constructor_type_errors(self):
         self.assertRaises(TypeError, self.type2test, 0.0)


More information about the Python-checkins mailing list