1. Yuya Nishihara
  2. thg-qt-mq


thg-qt-mq / thgcli-qsettings.diff

# HG changeset patch
# Parent 5f849b13eb8eb499a1e9f61d2c3e1ab8983933dd
tests: add convenient method to access QSettings of running process

XXX seems not usable

diff --git a/tests/helpers.py b/tests/helpers.py
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -9,7 +9,7 @@ try:
 except ImportError:
     import StringIO
 from nose import tools
-from PyQt4.QtCore import QTextCodec
+from PyQt4.QtCore import QSettings, QTextCodec
 from mercurial import dispatch, encoding as encodingmod, ui as uimod
 from tortoisehg.util import hglib
@@ -306,6 +306,11 @@ class ThgClient(object):
     def configdir(self):
         return os.path.join(self._homedir, '.config')
+    def qsettings(self):
+        return QSettings(os.path.join(self.configdir, 'TortoiseHg',
+                                      'TortoiseHgQt.ini'),
+                         QSettings.IniFormat)
     def open(self):
         if self._proc:
             raise ValueError('already open')