def testIsEmpty(self): range = QgsDateRange(QDate(2010, 3, 1), QDate(2010, 6, 2)) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(), QDate(2010, 6, 2)) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(2010, 3, 1), QDate()) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(), QDate()) self.assertTrue(range.isEmpty()) range = QgsDateRange(QDate(2017, 3, 1), QDate(2010, 6, 2)) self.assertTrue(range.isEmpty()) range = QgsDateRange(QDate(2010, 3, 1), QDate(2010, 3, 1)) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(2010, 3, 1), QDate(2010, 3, 1), False, False) self.assertTrue(range.isEmpty())
def testIsEmpty(self): range = QgsDateRange(QDate(2010, 3, 1), QDate(2010, 6, 2)) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(), QDate(2010, 6, 2)) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(2010, 3, 1), QDate()) self.assertFalse(range.isEmpty()) # check QgsDateRange docs - this is treated as an infinite range, so is NOT empty range = QgsDateRange(QDate(), QDate()) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(2017, 3, 1), QDate(2010, 6, 2)) self.assertTrue(range.isEmpty()) range = QgsDateRange(QDate(2010, 3, 1), QDate(2010, 3, 1)) self.assertFalse(range.isEmpty()) range = QgsDateRange(QDate(2010, 3, 1), QDate(2010, 3, 1), False, False) self.assertTrue(range.isEmpty())