-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revision and refactor of python unit tests: Pep8 and 257 formatting. …
…Use helper to import unittest so that unittest2 and unittest are seemless. 3 tests currently fail - will review those tomorrow.
- Loading branch information
Showing
17 changed files
with
769 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""QGIS Unit tests for QgsApplication. | ||
.. note:: 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. | ||
""" | ||
__author__ = 'Tim Sutton (tim@linfiniti.com)' | ||
__date__ = '20/01/2011' | ||
__copyright__ = 'Copyright 2012, The Quantum GIS Project' | ||
# This will get replaced with a git SHA1 when you do a git archive | ||
__revision__ = '$Format:%H$' | ||
|
||
from utilities import getQgisTestApp, unittest | ||
QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp() | ||
|
||
|
||
class TestPyQgsApplication(unittest.TestCase): | ||
|
||
def testInvalidThemeName(self): | ||
"""Check using an invalid theme will fallback to 'default'""" | ||
QGISAPP.setThemeName('fooobar') | ||
myExpectedResult = 'default' | ||
myResult = QGISAPP.themeName() | ||
myMessage = ('Expected:\n%s\nGot:\n%s\n' % | ||
(myExpectedResult, myResult)) | ||
assert myExpectedResult == myResult, myMessage | ||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.