Skip to content
Permalink
Browse files

Unit tests for list based contains

  • Loading branch information
nyalldawson committed Jun 7, 2018
1 parent a69274a commit 3c8f80d1e6caaa198add91636c763de93e34e0d7
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/src/python/test_qgsrasterrange.py
@@ -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.
You can’t perform that action at this time.