Beispiel #1
0
    def testFileFilterString(self):
        formats = QgsVectorFileWriter.fileFilterString()
        self.assertTrue('gpkg' in formats)
        self.assertTrue('shp' in formats)
        self.assertTrue(formats.index('gpkg') < formats.index('shp'))
        self.assertTrue('ods' in formats)

        # alphabetical sorting
        formats2 = QgsVectorFileWriter.fileFilterString(QgsVectorFileWriter.VectorFormatOptions())
        self.assertNotEqual(formats.index('gpkg'), formats2.index('gpkg'))

        # hide non spatial
        formats = QgsVectorFileWriter.fileFilterString(QgsVectorFileWriter.SkipNonSpatialFormats)
        self.assertFalse('ods' in formats)
Beispiel #2
0
    def testFileFilterString(self):
        formats = QgsVectorFileWriter.fileFilterString()
        self.assertTrue('gpkg' in formats)
        self.assertTrue('shp' in formats)
        self.assertTrue(formats.index('gpkg') < formats.index('shp'))
        self.assertTrue('ods' in formats)

        # alphabetical sorting
        formats2 = QgsVectorFileWriter.fileFilterString(
            QgsVectorFileWriter.VectorFormatOptions())
        self.assertNotEqual(formats.index('gpkg'), formats2.index('gpkg'))

        # hide non spatial
        formats = QgsVectorFileWriter.fileFilterString(
            QgsVectorFileWriter.SkipNonSpatialFormats)
        self.assertFalse('ods' in formats)
    def testFileFilterString(self):
        formats = QgsVectorFileWriter.fileFilterString()
        self.assertTrue('gpkg' in formats)
        self.assertTrue('shp' in formats)
        self.assertLess(formats.index('gpkg'), formats.index('shp'))
        self.assertTrue('ods' in formats)
        parts = formats.split(';;')
        for i in range(2, len(parts) - 1):
            self.assertLess(parts[i].lower(), parts[i + 1].lower())

        # alphabetical sorting
        formats2 = QgsVectorFileWriter.fileFilterString(QgsVectorFileWriter.VectorFormatOptions())
        self.assertNotEqual(formats.index('gpkg'), formats2.index('gpkg'))
        parts = formats2.split(';;')
        for i in range(len(parts) - 1):
            self.assertLess(parts[i].lower(), parts[i + 1].lower())

        # hide non spatial
        formats = QgsVectorFileWriter.fileFilterString(QgsVectorFileWriter.SkipNonSpatialFormats)
        self.assertFalse('ods' in formats)
    def testFileFilterString(self):
        formats = QgsVectorFileWriter.fileFilterString()
        self.assertTrue('gpkg' in formats)
        self.assertTrue('shp' in formats)
        self.assertLess(formats.index('gpkg'), formats.index('shp'))
        self.assertTrue('ods' in formats)
        parts = formats.split(';;')
        for i in range(2, len(parts) - 1):
            self.assertLess(parts[i].lower(), parts[i + 1].lower())

        # alphabetical sorting
        formats2 = QgsVectorFileWriter.fileFilterString(QgsVectorFileWriter.VectorFormatOptions())
        self.assertNotEqual(formats.index('gpkg'), formats2.index('gpkg'))
        parts = formats2.split(';;')
        for i in range(len(parts) - 1):
            self.assertLess(parts[i].lower(), parts[i + 1].lower())

        # hide non spatial
        formats = QgsVectorFileWriter.fileFilterString(QgsVectorFileWriter.SkipNonSpatialFormats)
        self.assertFalse('ods' in formats)