Skip to content

Commit

Permalink
Unit tests for list based contains
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 13, 2018
1 parent a69274a commit 3c8f80d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/src/python/test_qgsrasterrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ def testContains(self):
self.assertFalse(range.contains(5))
self.assertFalse(range.contains(6))

def testContainsList(self):
self.assertFalse(QgsRasterRange.contains(1, []))
ranges = [QgsRasterRange(1, 5)]
self.assertTrue(QgsRasterRange.contains(3, ranges))
self.assertFalse(QgsRasterRange.contains(13, ranges))
ranges.append(QgsRasterRange(11, 15))
self.assertTrue(QgsRasterRange.contains(3, ranges))
self.assertTrue(QgsRasterRange.contains(13, ranges))
self.assertFalse(QgsRasterRange.contains(16, ranges))


if __name__ == '__main__':
unittest.main()

0 comments on commit 3c8f80d

Please sign in to comment.