1# -*- coding: utf-8 -*-
2"""QGIS Unit tests for the console
3
4.. note:: This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation; either version 2 of the License, or
7(at your option) any later version.
8"""
9__author__ = 'Matthias Kuhn'
10__date__ = '15.4.2016'
11__copyright__ = 'Copyright 2015, The QGIS Project'
12
13import qgis  # NOQA
14import os
15
16from qgis.testing import unittest, start_app
17from console import console
18from qgis.core import QgsSettings
19from qgis.PyQt.QtCore import QCoreApplication
20
21start_app()
22
23
24class TestConsole(unittest.TestCase):
25
26    def setUp(self):
27        QgsSettings().setValue('pythonConsole/contextHelpOnFirstLaunch', False)
28
29    def test_show_console(self):
30        if os.name == 'nt':
31            QCoreApplication.setOrganizationName("QGIS")
32            QCoreApplication.setOrganizationDomain("qgis.org")
33            QCoreApplication.setApplicationName("QGIS-TEST")
34
35        my_console = console.show_console()
36        my_console_widget = my_console.console
37
38
39if __name__ == "__main__":
40    unittest.main()
41