/
test_qgsanalysis.py
60 lines (51 loc) · 2.02 KB
/
test_qgsanalysis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- coding: utf-8 -*-
'''
test_analysis.py
--------------------------------------
Date : September 2012
Copyright : (C) 2012 by Tim Sutton
email : tim@linfiniti.com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
'''
import unittest
import sys
import os
from utilities import unitTestDataPath, getQgisTestApp
from PyQt4.QtCore import QFileInfo, QDir, QStringList
from PyQt4.QtXml import QDomDocument
# support python < 2.7 via unittest2
# needed for expected failure decorator
if sys.version_info[0:2] < (2,7):
try:
from unittest2 import TestCase, expectedFailure
except ImportError:
print "You should install unittest2 to run the salt tests"
sys.exit(0)
else:
from unittest import TestCase, expectedFailure
QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp()
TEST_DATA_DIR = unitTestDataPath()
class TestQgsZonalStatistics(TestCase):
def setUp(self):
"""Run before each test."""
pass
def tearDown(self):
"""Run after each test."""
pass
#@expectedFailure
def testSubstitutionMap(self):
"""Test that we can import zonal statistics was failing as of d5f6543
"""
try:
from qgis.analysis import QgsZonalStatistics
except ImportError:
self.fail('Failed to import zonal statistics python module')
if __name__ == '__main__':
unittest.main()