def test_is_native_file_3_file(self): """Test native package of format 3""" source = DebianSource('.') os.makedirs('debian/source') dsf = DebianSourceFormat.from_content("3.0", "native") self.assertEqual(dsf.type, 'native') self.assertTrue(source.is_native(False)) dsf = DebianSourceFormat.from_content("3.0", "quilt") self.assertEqual(dsf.type, 'quilt') self.assertFalse(source.is_native(True))
def test_is_native_file_3_file(self): """Test native package of format 3""" source = DebianSource('.') os.makedirs('debian/source') self.assertRaises(DebianSourceError, source.is_native) dsf = DebianSourceFormat.from_content("3.0", "native") self.assertEqual(dsf.type, 'native') self.assertTrue(source.is_native()) dsf = DebianSourceFormat.from_content("3.0", "quilt") self.assertEqual(dsf.type, 'quilt') self.assertFalse(source.is_native())
def _commit_format(self, version, format): # Commit a format file to disk if not os.path.exists('debian/source'): os.makedirs('debian/source') dsf = DebianSourceFormat.from_content(version, format) self.assertEqual(dsf.type, format) self.repo.add_files('.') self.repo.commit_all('foo') os.unlink('debian/source/format') self.assertFalse(os.path.exists('debian/source/format'))
def _commit_format(self, version, format): # Commit a format file to disk if not os.path.exists('debian/source'): os.makedirs('debian/source') dsf = DebianSourceFormat.from_content(version, format) self.assertEqual(dsf.type, format) self.repo.add_files('.') self.repo.commit_all('foo') os.unlink('debian/source/format') self.assertFalse(os.path.exists('debian/source/format'))