def testCreate(self):
     val = CoreFoundation.CFAttributedStringCreate(
         None, b"hello".decode("ascii"), {b"foo".decode("ascii"): 42})
     self.assertIsInstance(val, CoreFoundation.CFAttributedStringRef)
     val = CoreFoundation.CFAttributedStringCreateWithSubstring(
         None, val, (1, 2))
     self.assertIsInstance(val, CoreFoundation.CFAttributedStringRef)
     val2 = CoreFoundation.CFAttributedStringCreateCopy(None, val)
     self.assertIs(val2, val)