Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def testShowTargetBasicInfo(self):
args = {
u'': u'samplescli/test.pbxproj',
u'--target': u'test',
u'--source-files': None,
u'--header-files': None,
u'--resource-files': None,
u'--framework-files': None,
u'--configurations': None,
u'--build-phase-files': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertNotIn('testUITests:', result)
self.assertNotIn('Product name: testUITests', result)
self.assertIn('test:', result)
self.assertIn('Product name: test\n', result)
def testShowTargetExplicitBuildPhase(self):
args = {
u'': u'samplescli/dependency.xcodeproj/project.pbxproj',
u'--target': u'helloworld',
u'--source-files': None,
u'--header-files': None,
u'--resource-files': None,
u'--framework-files': None,
u'--configurations': None,
u'--build-phase-files': u'PBXFrameworksBuildPhase'
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('helloworld:', result)
self.assertIn('Product name: helloworld\n', result)
self.assertIn('Frameworks:', result)
self.assertIn('AppKit.framework', result)
def testShowTargetResources(self):
args = {
u'': u'samplescli/test.pbxproj',
u'--target': u'test',
u'--source-files': None,
u'--header-files': None,
u'--resource-files': True,
u'--framework-files': None,
u'--configurations': None,
u'--build-phase-files': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('test:', result)
self.assertIn('Product name: test\n', result)
self.assertIn('Resources:', result)
self.assertIn('Assets.xcassets', result)
self.assertIn('LaunchScreen.storyboard', result)
self.assertIn('Main.storyboard', result)
def testShowTargetHeaders(self):
args = {
u'': u'samplescli/dependency.xcodeproj/project.pbxproj',
u'--target': u'helloworld',
u'--source-files': None,
u'--header-files': True,
u'--resource-files': None,
u'--framework-files': None,
u'--configurations': None,
u'--build-phase-files': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('helloworld:', result)
self.assertIn('Product name: helloworld\n', result)
self.assertIn('Headers:', result)
self.assertIn('doit.h', result)
self.assertIn('helloworld.h', result)
def testShowTargetFrameworks(self):
args = {
u'': u'samplescli/dependency.xcodeproj/project.pbxproj',
u'--target': u'helloworld',
u'--source-files': None,
u'--header-files': None,
u'--resource-files': None,
u'--framework-files': True,
u'--configurations': None,
u'--build-phase-files': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('helloworld:', result)
self.assertIn('Product name: helloworld\n', result)
self.assertIn('Frameworks:', result)
self.assertIn('AppKit.framework', result)
def testShowAllTargetsInfo(self):
args = {
u'': u'samplescli/test.pbxproj',
u'--target': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('testUITests:', result)
self.assertIn('Product name: testUITests', result)
self.assertIn('Configurations: Debug, Release', result)
self.assertIn('Sources (PBXSourcesBuildPhase) file count: 1', result)
self.assertIn('test:', result)
self.assertIn('Product name: test\n', result)
self.assertIn('Configurations: Debug, Release', result)
self.assertIn('Sources (PBXSourcesBuildPhase) file count: 2', result)
def testShowTargetConfigurations(self):
args = {
u'': u'samplescli/test.pbxproj',
u'--target': u'test',
u'--source-files': None,
u'--header-files': None,
u'--resource-files': None,
u'--framework-files': None,
u'--configurations': True,
u'--build-phase-files': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('test:', result)
self.assertIn('Product name: test\n', result)
self.assertIn('Configurations: Debug, Release\n', result)
def testShowTargetSources(self):
args = {
u'': u'samplescli/test.pbxproj',
u'--target': u'test',
u'--source-files': True,
u'--header-files': None,
u'--resource-files': None,
u'--framework-files': None,
u'--configurations': None,
u'--build-phase-files': None
}
project = open_project(args)
result = pbxproj_show.execute(project, args)
self.assertIn('test:', result)
self.assertIn('Product name: test\n', result)
self.assertIn('Sources:', result)
self.assertIn('AppDelegate.swift', result)
self.assertIn('ViewController.swift', result)