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))
def test_data_inexistent(self): m = ManifestModel(self.repo, rev=0) self.assertEqual(None, m.data(QModelIndex())) self.assertEqual(None, m.data(m.index(0, 0, m.index(1, 0))))
def test_data_subdir(self): m = ManifestModel(self.repo, rev=0) self.assertEqual('bax', m.data(m.index(0, 0, m.index(0, 0)))) self.assertEqual('box', m.data(m.index(1, 0, m.index(0, 0))))
def test_data(self): m = ManifestModel(self.repo, rev=0) self.assertEqual('bar', m.data(m.index(1, 0))) self.assertEqual('baz', m.data(m.index(0, 0))) self.assertEqual('foo', m.data(m.index(2, 0)))
def test_data(self): m = ManifestModel(self.repo, rev=0) self.assertEqual(_aloha_ja, m.data(m.index(0, 0)))
def test_status_role_invalid(self): m = ManifestModel(self.repo, rev=0) self.assertEqual(None, m.data(QModelIndex(), role=ManifestModel.StatusRole))