Commits

Bob Ippolito committed dc3f54e

Clean up a spelling error in the test,
fix all tests except test_methods2 to not have warnings (I think)

Comments (0)

Files changed (4)

Lib/Foundation/test/test_nsstring.py

 
     def testFormatting(self):
 
-        self.assertRaises(TypeError, NSString.stringWithFormat_, "foo")
+        self.assertRaises(TypeError, NSString.stringWithFormat_, u"foo")
 
         # The test on instances is slightly more verbose to avoid warnings
         try:
             obj = NSString.alloc()
-            self.assertRaises(TypeError, obj.initWithFormat_, "foo")
-            obj = obj.initWithString_("foo")
+            self.assertRaises(TypeError, obj.initWithFormat_, u"foo")
+            obj = obj.initWithString_(u"foo")
         except AssertionError, msg:
             raise
 
         try:
             obj = NSString.alloc()
-            self.assertRaises(TypeError, obj.initWithFormat_locale_, "foo", {})
-            obj = obj.initWithString_("foo")
+            self.assertRaises(TypeError, obj.initWithFormat_locale_, u"foo", {})
+            obj = obj.initWithString_(u"foo")
         except AssertionError, msg:
             raise
 
         try:
             obj = NSString.alloc()
-            self.assertRaises(TypeError, obj.initWithFormat_arguments_, "foo", [])
-            obj = obj.initWithString_("foo")
+            self.assertRaises(TypeError, obj.initWithFormat_arguments_, u"foo", [])
+            obj = obj.initWithString_(u"foo")
         except AssertionError, msg:
             raise
 
         try:
             obj = NSString.alloc()
-            self.assertRaises(TypeError, obj.initWithFormat_locale_arguments_, "foo", {}, [])
-            obj = obj.initWithString_("foo")
+            self.assertRaises(TypeError, obj.initWithFormat_locale_arguments_, u"foo", {}, [])
+            obj = obj.initWithString_(u"foo")
         except AssertionError, msg:
             raise
 
 
             objc.setStrBridgeEnabled(False)
 
-            warnings.filterwarnings('error', category=objc.PyObjCStrBridgeWarning) 
+            warnings.filterwarnings('error', category=objc.PyObjCStrBridgeWarning)
             try:
                 #v = NSString.stringWithString_("hello")
                 self.assertRaises(objc.PyObjCStrBridgeWarning,

Lib/objc/test/test_identity.py

     def testMakePlist(self):
         container = OC_TestIdentity.alloc().init()
 
-        value = [ 1, 2, 3, [ "hello", ["world", ("in", 9 ) ], True, { "aap":3}]]
+        value = [ 1, 2, 3, [ u"hello", [u"world", (u"in", 9 ) ], True, {u"aap":3}]]
         value.append(value[3])
 
         container.setStoredObject_(value)
-        container.writeStoredObjecToFile_("/tmp/pyobjc.test.identity")
+        container.writeStoredObjectToFile_(u"/tmp/pyobjc.test.identity")
 
         value = {
-            "hello": [ 1, 2, 3],
-            "world": {
-                "nl": "wereld",
-                "de": "Welt",
+            u"hello": [ 1, 2, 3],
+            u"world": {
+                u"nl": u"wereld",
+                u"de": u"Welt",
             }
         }
         container.setStoredObject_(value)
-        container.writeStoredObjecToFile_("/tmp/pyobjc.test.identity")
+        container.writeStoredObjectToFile_(u"/tmp/pyobjc.test.identity")
 
         
 

Lib/objc/test/test_posing.py

         class PoseClass(BaseClass):
             __slots__ = ()  # Don't add instance variables, not even __dict__
             def testPosingMethod(self):
-                return "<PoseClass instance>"
+                return u"<PoseClass instance>"
 
 
         PoseClass.poseAsClass_(BaseClass)
         # BaseClass still refers to the old class, if we look it up again
         # we get to see the new value. There's not much we can do about that.
         obj = objc.lookUpClass(BaseName).new()
-        self.assertEquals(obj.testPosingMethod(), "<PoseClass instance>")
+        self.assertEquals(obj.testPosingMethod(), u"<PoseClass instance>")
 
         # XXX: next assertion fails because the runtime seems to copy the
         # original class.

Modules/objc/test/identity.m

 -(void)setStoredObjectAnInstanceOf:(Class) cls;
 -(void)setStoredObjectAnInstanceOfClassic:(Class) cls;
 
--(void)writeStoredObjecToFile:(NSString*)fname;
+-(void)writeStoredObjectToFile:(NSString*)fname;
 
 @end
 
 	[self setStoredClassicObject:[cls new]];
 }
 
--(void)writeStoredObjecToFile:(NSString*)fname
+-(void)writeStoredObjectToFile:(NSString*)fname
 {
 	[(NSArray*)storedObject writeToFile:fname atomically:YES];
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.