def testAddCompilerFlagWithFlags(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags=[u'Weak', '-fno-arc']) dobj.add_compiler_flags('x') self.assertIsNotNone(dobj.settings.COMPILER_FLAGS) self.assertEquals(dobj.settings.COMPILER_FLAGS, u'Weak -fno-arc x')
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 testAddAttributesWithoutAttributes(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags="x") dobj.add_attributes(u'Weak') self.assertIsNotNone(dobj.settings.ATTRIBUTES) self.assertEquals(dobj.settings.ATTRIBUTES, [u'Weak'])
def testGetAttributesWithAttributes(self): dobj = PBXBuildFile.create(PBXGenericObject(), attributes='x') attributes = dobj.get_attributes() self.assertIsNotNone(attributes) self.assertEqual(attributes, ['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 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 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 testAddAttributesWithoutSettings(self): dobj = PBXBuildFile.create(PBXGenericObject()) dobj.add_attributes(u'Weak') self.assertIsNotNone(dobj.settings.ATTRIBUTES) self.assertEquals(dobj.settings.ATTRIBUTES, [u'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 testPrintOnSingleLine(self): obj = {"isa": "PBXBuildFile", "name": "something"} dobj = PBXBuildFile().parse(obj) self.assertEqual(dobj.__repr__(), "{isa = PBXBuildFile; name = something; }")
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 testRemoveCompilerFlagsWithSettings(self): dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags=u'Weak') dobj.remove_compiler_flags('Weak') self.assertIsNone(dobj[u'settings'])
def testRemoveAttributesWithSettings(self): dobj = PBXBuildFile.create(PBXGenericObject(), attributes=["Weak"]) dobj.remove_attributes('Weak') self.assertIsNone(dobj[u'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'])
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 testPrintOnSingleLine(self): obj = {"isa": "PBXBuildFile", "name": "something"} dobj = PBXBuildFile().parse(obj) self.assertEqual(dobj.__repr__(), "{isa = PBXBuildFile; name = something; }")