Ejemplo n.º 1
0
    def checkTest(self, **kwargs):
        self.lyr.writeToLayer(self.layer)
        self.saveControlImage()
        self.assertTrue(*self.renderCheck())


class TestCanvasBasePoint(TestCanvasBase):

    @classmethod
    def setUpClass(cls):
        TestCanvasBase.setUpClass()
        cls.layer = TestQgsPalLabeling.loadFeatureLayer('point')


class TestCanvasPoint(TestCanvasBasePoint, TestPointBase):

    def setUp(self):
        """Run before each test."""
        super(TestCanvasPoint, self).setUp()
        self.configTest('pal_canvas', 'sp')


if __name__ == '__main__':
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    suite = (
        ['TestCanvasPoint.' + t for t in suiteTests()['sp_suite']]
    )
    res = runSuite(sys.modules[__name__], suite)
    sys.exit(not res.wasSuccessful())
Ejemplo n.º 2
0
    Compare only to composer image, which is already compared to canvas line
    """

    def setUp(self):
        """Run before each test."""
        super(TestComposerPdfVsComposerLine, self).setUp()
        self._TestKind = OutputKind.Pdf
        self.configTest('pal_composer_line', 'sp_img')
        self._Mismatch = 50
        self._ColorTol = 18


if __name__ == '__main__':
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    st = suiteTests()
    sp_i = ['TestComposerImagePoint.' + t for t in st['sp_suite']]
    sp_ivs = ['TestComposerImageVsCanvasPoint.' + t for t in st['sp_vs_suite']]
    sp_s = ['TestComposerSvgPoint.' + t for t in st['sp_suite']]
    sp_svs = ['TestComposerSvgVsComposerPoint.' + t for t in st['sp_vs_suite']]
    sp_p = ['TestComposerPdfPoint.' + t for t in st['sp_suite']]
    sp_pvs = ['TestComposerPdfVsComposerPoint.' + t for t in st['sp_vs_suite']]
    suite = []

    # extended separately for finer control of PAL_SUITE (comment-out undesired)
    suite.extend(sp_i)
    suite.extend(sp_ivs)
    suite.extend(sp_s)
    suite.extend(sp_svs)
    suite.extend(sp_p)
    suite.extend(sp_pvs)
Ejemplo n.º 3
0
    @classmethod
    def setUpClass(cls):
        TestServerBase.setUpClass()
        cls.layer = TestQgsPalLabeling.loadFeatureLayer('line')


class TestServerLine(TestServerBaseLine, TestLineBase):

    def setUp(self):
        """Run before each test."""
        super(TestServerLine, self).setUp()
        self.configTest('pal_server_line', 'sp')


class TestServerVsCanvasLine(TestServerBaseLine, TestLineBase):

    def setUp(self):
        super(TestServerVsCanvasLine, self).setUp()
        self.configTest('pal_canvas_line', 'sp')


if __name__ == '__main__':
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    suite = (
        ['TestServerPoint.' + t for t in suiteTests()['sp_suite']] +
        ['TestServerVsCanvasPoint.' + t for t in suiteTests()['sp_vs_suite']]
    )
    res = runSuite(sys.modules[__name__], suite)
    sys.exit(not res.wasSuccessful())
        cls.layer = TestQgsPalLabeling.loadFeatureLayer("point")


class TestCanvasPoint(TestCanvasBasePoint, TestPointBase):
    def setUp(self):
        """Run before each test."""
        super(TestCanvasPoint, self).setUp()
        self.configTest("pal_canvas", "sp")


class TestCanvasBaseLine(TestCanvasBase):
    @classmethod
    def setUpClass(cls):
        TestCanvasBase.setUpClass()
        cls.layer = TestQgsPalLabeling.loadFeatureLayer("line")


class TestCanvasLine(TestCanvasBaseLine, TestLineBase):
    def setUp(self):
        """Run before each test."""
        super(TestCanvasLine, self).setUp()
        self.configTest("pal_canvas_line", "sp")


if __name__ == "__main__":
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    suite = ["TestCanvasPoint." + t for t in suiteTests()["sp_suite"]]
    res = runSuite(sys.modules[__name__], suite)
    sys.exit(not res.wasSuccessful())
Ejemplo n.º 5
0
        self.assertTrue(*self.renderCheck(mismatch=mismatch, colortol=colortol, imgpath=self._TestImage))


class TestServerBasePoint(TestServerBase):
    @classmethod
    def setUpClass(cls):
        TestServerBase.setUpClass()
        cls.layer = TestQgsPalLabeling.loadFeatureLayer("point")


class TestServerPoint(TestServerBasePoint, TestPointBase):
    def setUp(self):
        super(TestServerPoint, self).setUp()
        self.configTest("pal_server", "sp")


class TestServerVsCanvasPoint(TestServerBasePoint, TestPointBase):
    def setUp(self):
        super(TestServerVsCanvasPoint, self).setUp()
        self.configTest("pal_canvas", "sp")


if __name__ == "__main__":
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    suite = ["TestServerPoint." + t for t in suiteTests()["sp_suite"]] + [
        "TestServerVsCanvasPoint." + t for t in suiteTests()["sp_vs_suite"]
    ]
    res = runSuite(sys.modules[__name__], suite)
    sys.exit(not res.wasSuccessful())
    """
    Compare only to layout image, which is already compared to canvas line
    """
    def setUp(self):
        """Run before each test."""
        super(TestLayoutPdfVsLayoutLine, self).setUp()
        self._TestKind = OutputKind.Pdf
        self.configTest('pal_composer_line', 'sp_img')
        self._Mismatch = 50
        self._ColorTol = 18


if __name__ == '__main__':
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    st = suiteTests()
    sp_i = ['TestLayoutImagePoint.' + t for t in st['sp_suite']]
    sp_ivs = ['TestLayoutImageVsCanvasPoint.' + t for t in st['sp_vs_suite']]
    sp_s = ['TestLayoutSvgPoint.' + t for t in st['sp_suite']]
    sp_svs = ['TestLayoutSvgVsLayoutPoint.' + t for t in st['sp_vs_suite']]
    sp_p = ['TestLayoutPdfPoint.' + t for t in st['sp_suite']]
    sp_pvs = ['TestLayoutPdfVsLayoutPoint.' + t for t in st['sp_vs_suite']]
    suite = []

    # extended separately for finer control of PAL_SUITE (comment-out undesired)
    suite.extend(sp_i)
    suite.extend(sp_ivs)
    suite.extend(sp_s)
    suite.extend(sp_svs)
    suite.extend(sp_p)
    suite.extend(sp_pvs)
Ejemplo n.º 7
0
    @classmethod
    def setUpClass(cls):
        TestServerBase.setUpClass()
        cls.layer = TestQgsPalLabeling.loadFeatureLayer('line')


class TestServerLine(TestServerBaseLine, TestLineBase):

    def setUp(self):
        """Run before each test."""
        super(TestServerLine, self).setUp()
        self.configTest('pal_server_line', 'sp')


class TestServerVsCanvasLine(TestServerBaseLine, TestLineBase):

    def setUp(self):
        super(TestServerVsCanvasLine, self).setUp()
        self.configTest('pal_canvas_line', 'sp')


if __name__ == '__main__':
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    suite = (
        ['TestServerPoint.' + t for t in suiteTests()['sp_suite']] +
        ['TestServerVsCanvasPoint.' + t for t in suiteTests()['sp_vs_suite']]
    )
    res = runSuite(sys.modules[__name__], suite)
    sys.exit(not res.wasSuccessful())
        cls.layer = TestQgsPalLabeling.loadFeatureLayer('point')


class TestCanvasPoint(TestCanvasBasePoint, TestPointBase):
    def setUp(self):
        """Run before each test."""
        super(TestCanvasPoint, self).setUp()
        self.configTest('pal_canvas', 'sp')


class TestCanvasBaseLine(TestCanvasBase):
    @classmethod
    def setUpClass(cls):
        TestCanvasBase.setUpClass()
        cls.layer = TestQgsPalLabeling.loadFeatureLayer('line')


class TestCanvasLine(TestCanvasBaseLine, TestLineBase):
    def setUp(self):
        """Run before each test."""
        super(TestCanvasLine, self).setUp()
        self.configTest('pal_canvas_line', 'sp')


if __name__ == '__main__':
    # NOTE: unless PAL_SUITE env var is set all test class methods will be run
    # SEE: test_qgspallabeling_tests.suiteTests() to define suite
    suite = (['TestCanvasPoint.' + t for t in suiteTests()['sp_suite']])
    res = runSuite(sys.modules[__name__], suite)
    sys.exit(not res.wasSuccessful())