def testCheckBuildRequired(self): """Tests the CheckBuildRequired function.""" project_definition = projects.ProjectDefinition('test') build_helper_object = build_helper.BuildHelper(project_definition, '') result = build_helper_object.CheckBuildRequired(None) self.assertTrue(result)
def testCheckBuildDependencies(self): """Tests the CheckBuildDependencies function.""" project_definition = projects.ProjectDefinition('test') build_helper_object = build_helper.BuildHelper(project_definition, '') build_dependencies = build_helper_object.CheckBuildDependencies() self.assertEqual(build_dependencies, [])
def testGenerateChangelogFile(self): """Tests the _GenerateChangelogFile function.""" project_definition = projects.ProjectDefinition('test') dpkg_files_generator = dpkg_files.DPKGBuildFilesGenerator( project_definition, '1.0', 'data_path', {}) _ = dpkg_files_generator
def testRunLSBReleaseCommand(self): """Tests the _RunLSBReleaseCommand function.""" project_definition = projects.ProjectDefinition('test') l2tdevtools_path = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) test_build_helper = dpkg.DPKGBuildHelper(project_definition, l2tdevtools_path, {}) output = test_build_helper._RunLSBReleaseCommand() if os.path.exists('/usr/bin/lsb_release'): self.assertIsNotNone(output) else: self.assertIsNone(output)
def _CreateTestWriter(self): """Creates a dependency file writer for testing. Returns: GIFTPPAInstallScriptWriter: dependency file writer for testing. """ project_definition = projects.ProjectDefinition('test') configuration_file = self._GetTestFilePath(['dependencies.ini']) dependency_helper = dependencies.DependencyHelper( configuration_file=configuration_file) configuration_file = self._GetTestFilePath(['test_dependencies.ini']) test_dependency_helper = dependencies.DependencyHelper( configuration_file=configuration_file) return gift_ppa.GIFTPPAInstallScriptWriter( '/fake/l2tdevtools/', project_definition, dependency_helper, test_dependency_helper)
def _CreateTestWriter(self): """Creates a dependency file writer for testing. Returns: TestRequirementsWriter: dependency file writer for testing. """ project_definition = projects.ProjectDefinition('test') configuration_file = self._GetTestFilePath(['dependencies.ini']) dependency_helper = dependencies.DependencyHelper( configuration_file=configuration_file) configuration_file = self._GetTestFilePath(['test_dependencies.ini']) test_dependency_helper = dependencies.DependencyHelper( configuration_file=configuration_file) return requirements.TestRequirementsWriter('/fake/l2tdevtools/', project_definition, dependency_helper, test_dependency_helper)
def testReadLSBReleaseConfigurationFile(self): """Tests the _ReadLSBReleaseConfigurationFile function.""" project_definition = projects.ProjectDefinition('test') l2tdevtools_path = os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) test_path = self._GetTestFilePath(['lsb-release']) test_build_helper = dpkg.DPKGBuildHelper(project_definition, l2tdevtools_path, {}) lsb_release_values = test_build_helper._ReadLSBReleaseConfigurationFile( test_path) self.assertEqual(len(lsb_release_values), 4) expected_keys = [ 'distrib_codename', 'distrib_description', 'distrib_id', 'distrib_release' ] self.assertEqual(sorted(lsb_release_values.keys()), expected_keys)
def testIsPython2Only(self): """Tests the IsPython2Only function.""" project_definition = projects.ProjectDefinition('test') result = project_definition.IsPython2Only() self.assertFalse(result)
def testInitialize(self): """Tests the __init__ function.""" project_definition = projects.ProjectDefinition('name') self.assertIsNotNone(project_definition)