Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 14, 2020
1 parent e01cf94 commit 59a7bb6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/src/python/test_qgstablecell.py
Expand Up @@ -36,7 +36,7 @@ def testCell(self):
self.assertFalse(c.backgroundColor().isValid())
self.assertFalse(c.foregroundColor().isValid())
self.assertFalse(c.numericFormat())
self.assertFalse(c.hasTextFormat())
self.assertFalse(c.textFormat().isValid())

c.setBackgroundColor(QColor(255, 0, 0))
c.setForegroundColor(QColor(255, 0, 255))
Expand All @@ -48,9 +48,8 @@ def testCell(self):
format = QgsTextFormat()
format.setSize(16.8)
c.setTextFormat(format)
c.setHasTextFormat(True)
self.assertEqual(c.textFormat().size(), 16.8)
self.assertTrue(c.hasTextFormat())
self.assertTrue(c.textFormat().isValid())

def testProperties(self):
c = QgsTableCell('test')
Expand All @@ -64,7 +63,7 @@ def testProperties(self):
self.assertFalse(c2.backgroundColor().isValid())
self.assertFalse(c2.foregroundColor().isValid())
self.assertFalse(c2.numericFormat())
self.assertFalse(c2.hasTextFormat())
self.assertFalse(c2.textFormat().isValid())

c.setBackgroundColor(QColor(255, 0, 0))
c.setForegroundColor(QColor(255, 0, 255))
Expand All @@ -74,7 +73,6 @@ def testProperties(self):
text_format = QgsTextFormat()
text_format.setSize(16.8)
c.setTextFormat(text_format)
c.setHasTextFormat(True)
props = c.properties(QgsReadWriteContext())

c3 = QgsTableCell()
Expand All @@ -86,7 +84,7 @@ def testProperties(self):
self.assertIsInstance(c3.numericFormat(), QgsBearingNumericFormat)
self.assertTrue(c3.numericFormat().showPlusSign())
self.assertEqual(c3.textFormat().size(), 16.8)
self.assertTrue(c3.hasTextFormat())
self.assertTrue(c3.textFormat().isValid())


if __name__ == '__main__':
Expand Down

0 comments on commit 59a7bb6

Please sign in to comment.