Example #1
0
    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__())
Example #2
0
    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'])
Example #3
0
    def testAddAttributeList(self):
        dobj = PBXBuildFile.create(PBXGenericObject())

        dobj.add_attributes(['Weak', 'Custom'])

        self.assertIsNotNone(dobj.settings.ATTRIBUTES)
        self.assertEqual(dobj.settings.ATTRIBUTES, ['Weak', 'Custom'])
Example #4
0
    def testGetAttributesWithAttributes(self):
        dobj = PBXBuildFile.create(PBXGenericObject(), attributes='x')

        attributes = dobj.get_attributes()

        self.assertIsNotNone(attributes)
        self.assertEqual(attributes, ['x'])
Example #5
0
    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'])
Example #8
0
    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'])
Example #9
0
    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')
Example #10
0
    def testGetCompilerFlagsWithoutFlags(self):
        dobj = PBXBuildFile.create(PBXGenericObject(), attributes='x')

        self.assertIsNone(dobj.get_compiler_flags())
Example #11
0
    def testGetCompilerFlagsWithoutSettings(self):
        dobj = PBXBuildFile.create(PBXGenericObject())

        self.assertIsNone(dobj.get_compiler_flags())
Example #12
0
    def testGetAttributesWithoutAttributes(self):
        dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags='x')

        attributes = dobj.get_attributes()

        self.assertIsNone(attributes)
Example #13
0
    def testGetAttributesWithoutSettings(self):
        dobj = PBXBuildFile.create(PBXGenericObject())

        attributes = dobj.get_attributes()

        self.assertIsNone(attributes)
Example #14
0
    def testRemoveCompilerFlagsWithSettings(self):
        dobj = PBXBuildFile.create(PBXGenericObject(), compiler_flags='Weak')

        dobj.remove_compiler_flags('Weak')

        self.assertIsNone(dobj['settings'])
Example #15
0
    def testRemoveAttributesWithSettings(self):
        dobj = PBXBuildFile.create(PBXGenericObject(), attributes=['Weak'])

        dobj.remove_attributes('Weak')

        self.assertIsNone(dobj['settings'])
Example #16
0
    def testRemoveAttributeList(self):
        dobj = PBXBuildFile.create(PBXGenericObject(), attributes=['Weak', 'Custom'])

        dobj.remove_attributes(['Weak', 'Custom'])

        self.assertIsNone(dobj['settings'])