Skip to content
Permalink
Browse files

Fix PyQgsVirtualLayerDefinition test on Windows

  • Loading branch information
nyalldawson committed Mar 31, 2016
1 parent cb14910 commit 9e759efc2c32e4b9e7082f4def9c4e956cd9e4db
Showing with 4 additions and 3 deletions.
  1. +4 −3 tests/src/python/test_qgsvirtuallayerdefinition.py
@@ -22,6 +22,7 @@

from qgis.testing import unittest
from PyQt.QtCore import QVariant, QUrl
import os


class TestQgsVirtualLayerDefinition(unittest.TestCase):
@@ -33,9 +34,9 @@ def test1(self):
self.assertEqual(d.toString(), "file:///file")
self.assertEqual(QgsVirtualLayerDefinition.fromUrl(d.toUrl()).filePath(), "/file")
self.assertEqual(QgsVirtualLayerDefinition.fromUrl(QUrl.fromEncoded(d.toString())).filePath(), "/file")
d.setFilePath("C:\\file")
self.assertEqual(d.toString(), "file:///C:%5Cfile")
self.assertEqual(QgsVirtualLayerDefinition.fromUrl(d.toUrl()).filePath(), "C:\\file")
d.setFilePath(os.path.join('C:/', 'file'))
self.assertEqual(d.toString(), "file:///C:/file")
self.assertEqual(QgsVirtualLayerDefinition.fromUrl(d.toUrl()).filePath(), os.path.join('C:/', 'file'))
d.setQuery("SELECT * FROM mytable")
self.assertEqual(QgsVirtualLayerDefinition.fromUrl(d.toUrl()).query(), "SELECT * FROM mytable")
self.assertEqual(QgsVirtualLayerDefinition.fromUrl(QUrl.fromEncoded(d.toString())).query(), "SELECT * FROM mytable")

0 comments on commit 9e759ef

Please sign in to comment.
You can’t perform that action at this time.