Commits

Yuya Nishihara committed 425802c

fin

Comments (0)

Files changed (3)

modeltest-omitpare.diff

-# HG changeset patch
-# Parent dd3cda9130720cac23ed072a677456f9fa02febc
-diff --git a/tests/modeltest.py b/tests/modeltest.py
---- a/tests/modeltest.py
-+++ b/tests/modeltest.py
-@@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui
- #        self.modeltest = ModelTest(model, self)
- 
- class ModelTest(QtCore.QObject):
--    def __init__(self, _model, parent):
-+    def __init__(self, _model, parent=None):
-         """
-         Connect to all of the models signals, Whenever anything happens recheck everything.
-         """
-test-patchqueuemodel.diff
 modeltest-move.diff
-modeltest-omitpare.diff
 settings-segfault-debug.diff
 mqd-curpatchname.diff
 mqd-qgotoclean.diff

test-patchqueuemodel.diff

-# HG changeset patch
-# Parent 412c1b52ed790d0007d147a54b752dcf0362c339
-
-diff --git a/tests/qt_patchqueuemodel_test.py b/tests/qt_patchqueuemodel_test.py
-new file mode 100644
---- /dev/null
-+++ b/tests/qt_patchqueuemodel_test.py
-@@ -0,0 +1,59 @@
-+import os, unittest
-+from PyQt4.QtGui import QItemSelectionModel
-+from tortoisehg.hgqt import modeltest, mq, thgrepo
-+
-+import helpers
-+
-+def setup():
-+    global _tmpdir
-+    _tmpdir = helpers.mktmpdir(__name__)
-+
-+class PatchQueueModelTest(unittest.TestCase):
-+
-+    @classmethod
-+    def setUpClass(cls):
-+        cls.hg = hg = helpers.HgClient(os.path.join(_tmpdir, cls.__name__))
-+        hg.init()
-+        hg.qnew('foo.diff')
-+        hg.qnew('bar.diff')
-+        hg.qnew('baz.diff')
-+        hg.qpop('-a')
-+        hg.qinit('-c')
-+        hg.commit('--mq', '-m', 'initial state')
-+
-+    def setUp(self):
-+        repo = thgrepo.repository(path=self.hg.path)
-+        repo.thginvalidate()  # because of global cache of thgrepo instance
-+        self.repoagent = thgrepo.RepoAgent(repo)
-+        self.model = mq.PatchQueueModel(self.repoagent)
-+        # TODO: omit None; is this really a good idea?
-+        self.modeltest = modeltest.ModelTest(self.model, None)
-+
-+    def tearDown(self):
-+        self.hg.qpop('-a')
-+        self.hg.update('--mq', '-C')
-+
-+    def test_patchname(self):
-+        m = self.model
-+        self.assertEqual('baz.diff', m.data(m.index(0, 0)))
-+        self.assertEqual('foo.diff', m.patchName(m.index(2, 0)))
-+
-+    def test_applied(self):
-+        self.hg.qpush()
-+        self.repoagent.pollStatus()
-+        m = self.model
-+        self.assertTrue(m.isApplied(m.index(2, 0)))
-+        self.assertFalse(m.isApplied(m.index(1, 0)))
-+
-+    def test_current_kept(self):
-+        m = self.model
-+        s = QItemSelectionModel(m)
-+        s.setCurrentIndex(m.index(1, 0), QItemSelectionModel.Current)
-+        self.hg.qdelete('baz.diff')  # delete first row
-+        self.repoagent.pollStatus()
-+        self.assertEqual(m.index(0, 0), s.currentIndex())
-+
-+
-+# XXX test selection
-+# XXX test mime data
-+# XXX test guards