def testRemoveCompilerFlagsList(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags=['Weak', 'Custom', 'Another']) dobj.remove_compiler_flags(['Weak', 'Custom']) self.assertIsNotNone(dobj['settings']) self.assertEqual(dobj['settings'].__repr__(), PBXGenericObject().parse({'COMPILER_FLAGS': 'Another'}).__repr__())
def testAddAttributesWithoutAttributes(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags='x') dobj.add_attributes('Weak') self.assertIsNotNone(dobj.settings.ATTRIBUTES) self.assertEqual(dobj.settings.ATTRIBUTES, ['Weak'])
def testAddAttributeList(self): dobj = PBXBuildFile.create(PBXGenericObject()) dobj.add_attributes(['Weak', 'Custom']) self.assertIsNotNone(dobj.settings.ATTRIBUTES) self.assertEqual(dobj.settings.ATTRIBUTES, ['Weak', 'Custom'])
def testGetAttributesWithAttributes(self): dobj = PBXBuildFile.create(PBXGenericObject(), attributes='x') attributes = dobj.get_attributes() self.assertIsNotNone(attributes) self.assertEqual(attributes, ['x'])
def testAddCompilerFlagWithFlags(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags=['Weak', '-fno-arc']) dobj.add_compiler_flags('x') self.assertIsNotNone(dobj.settings.COMPILER_FLAGS) self.assertEqual(dobj.settings.COMPILER_FLAGS, 'Weak -fno-arc x')
def testAddCompilerFlagWithoutSettings(self): dobj = PBXBuildFile.create(PBXGenericObject()) dobj.add_compiler_flags([u'Weak', '-fno-arc']) self.assertIsNotNone(dobj.settings.COMPILER_FLAGS) self.assertEquals(dobj.settings.COMPILER_FLAGS, u'Weak -fno-arc')
def testAddAttributesWithoutSettings(self): dobj = PBXBuildFile.create(PBXGenericObject()) dobj.add_attributes(u'Weak') self.assertIsNotNone(dobj.settings.ATTRIBUTES) self.assertEquals(dobj.settings.ATTRIBUTES, [u'Weak'])
def testRemoveNonRecursive(self): obj = { 'objects': { '1': {'isa': 'PBXBuildFile', 'fileRef': '0'}, '0': {'isa': 'PBXFileReference', 'path': 'x'}, '2': {'isa': 'PBXGenericBuildPhase', 'files': ['1']} } } project = PBXGenericObject().parse(obj) project.objects['1'].remove(recursive=False) self.assertIsNone(project.objects['1']) self.assertIsNotNone(project.objects['2'])
def testGetCompilerFlagsWithFlags(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags=['Weak', '-fno-arc']) self.assertIsNotNone(dobj.get_compiler_flags()) self.assertEqual(dobj.get_compiler_flags(), 'Weak -fno-arc')
def testGetCompilerFlagsWithoutFlags(self): dobj = PBXBuildFile.create(PBXGenericObject(), attributes='x') self.assertIsNone(dobj.get_compiler_flags())
def testGetCompilerFlagsWithoutSettings(self): dobj = PBXBuildFile.create(PBXGenericObject()) self.assertIsNone(dobj.get_compiler_flags())
def testGetAttributesWithoutAttributes(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags='x') attributes = dobj.get_attributes() self.assertIsNone(attributes)
def testGetAttributesWithoutSettings(self): dobj = PBXBuildFile.create(PBXGenericObject()) attributes = dobj.get_attributes() self.assertIsNone(attributes)
def testRemoveCompilerFlagsWithSettings(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags='Weak') dobj.remove_compiler_flags('Weak') self.assertIsNone(dobj['settings'])
def testRemoveAttributesWithSettings(self): dobj = PBXBuildFile.create(PBXGenericObject(), attributes=['Weak']) dobj.remove_attributes('Weak') self.assertIsNone(dobj['settings'])
def testRemoveAttributeList(self): dobj = PBXBuildFile.create(PBXGenericObject(), attributes=['Weak', 'Custom']) dobj.remove_attributes(['Weak', 'Custom']) self.assertIsNone(dobj['settings'])