Пример #1
0
 def test_status_filter_multi(self):
     m = ManifestModel(self.repo, rev=1)
     m.setStatusFilter('MC')
     self.assertNotEqual(QModelIndex(), m.indexFromPath('bar'))  # modified
     self.assertEqual(QModelIndex(), m.indexFromPath('zzz'))  # added
     self.assertEqual(QModelIndex(), m.indexFromPath('baz/box'))  # removed
     self.assertNotEqual(QModelIndex(), m.indexFromPath('foo'))  # clean
Пример #2
0
    def test_status_filter_change(self):
        m = ManifestModel(self.repo, rev=1)
        m.setStatusFilter('C')
        self.assertEqual(QModelIndex(), m.indexFromPath('bar'))  # modified
        self.assertNotEqual(QModelIndex(), m.indexFromPath('foo'))  # clean

        m.setStatusFilter('M')
        self.assertNotEqual(QModelIndex(), m.indexFromPath('bar'))  # modified
        self.assertEqual(QModelIndex(), m.indexFromPath('foo'))  # clean
Пример #3
0
    def test_status_role(self):
        m = ManifestModel(self.repo, rev=0)
        self.assertEqual('A', m.data(m.indexFromPath('foo'),
                                     role=ManifestModel.StatusRole))

        m = ManifestModel(self.repo, rev=1)
        m.setStatusFilter('MARC')
        self.assertEqual('C', m.data(m.indexFromPath('foo'),
                                     role=ManifestModel.StatusRole))
        self.assertEqual('R', m.data(m.indexFromPath('baz/box'),
                                     role=ManifestModel.StatusRole))
Пример #4
0
 def test_removed_should_be_listed(self):
     m = ManifestModel(self.repo, rev=1)
     m.setStatusFilter('MARC')
     self.assertTrue(m.indexFromPath('baz/box').isValid())